Tool to use a linear feedback shift register or LFSR and generate pseudo-random bits using XOR exclusive OR operations.

Linear Feedback Shift Register - dCode

Tag(s) : Informatics

dCode is free and its tools are a valuable help in games, maths, geocaching, puzzles and problems to solve every day!

A suggestion ? a feedback ? a bug ? an idea ? *Write to dCode*!

A linear feedback shift register or LFSR is a system that generates bits from a register and a feedback function.

After several iterations, the register returns to a previous state already known and starts again in a loop, the number of iterations of which is called its period.

In practice, this kind of LFSR register is useful in cryptography because it allows the generation of pseudo-random numbers when the period is long enough.

From a current state of the register, a bit selection is chosen to apply an XOR operation to it.

The result is then concatenated at the start of the register (on the left) while the final value (on the right) is deleted from the register and displayed at the output.

__Example:__ The register is `1010`, an XOR ⊕ is applied to bits 0 and 2 (numbered from left to right starting from 0)

Step | Register | XOR | Output |
---|---|---|---|

0 | _______0101 | 0 ⊕ 0 = 0 | |

1 | ______0010_ | 0 ⊕ 1 = 1 | 1 |

2 | _____1001__ | 1 ⊕ 0 = 1 | 0 |

3 | ____1100___ | 1 ⊕ 0 = 1 | 1 |

4 | ___1110____ | 1 ⊕ 1 = 0 | 0 |

5 | __0111_____ | 0 ⊕ 1 = 1 | 0 |

6 | _1011______ | 0 ⊕ 1 = 1 | 1 |

7 | 0101_______ | 0 ⊕ 0 = 0 | 1 |

dCode retains ownership of the "Linear Feedback Shift Register" source code. Except explicit open source licence (indicated Creative Commons / free), the "Linear Feedback Shift Register" algorithm, the applet or snippet (converter, solver, encryption / decryption, encoding / decoding, ciphering / deciphering, translator), or the "Linear Feedback Shift Register" functions (calculate, convert, solve, decrypt / encrypt, decipher / cipher, decode / encode, translate) written in any informatic language (Python, Java, PHP, C#, Javascript, Matlab, etc.) and all data download, script, or API access for "Linear Feedback Shift Register" are not public, same for offline use on PC, tablet, iPhone or Android !

The copy-paste of the page "Linear Feedback Shift Register" or any of its results, is allowed as long as you cite the online source

Reminder : dCode is free to use.

lfsr,register,shift,feedback,linear,xor,random,binary

Source : https://www.dcode.fr/linear-feedback-shift-register

© 2022 dCode — The ultimate 'toolkit' to solve every games / riddles / geocaching / CTF.

Feedback