0% found this document useful (0 votes)
110 views

Lfsr-Computer Networks

Linear feedback shift registers (LFSRs) are commonly used in cryptography. An LFSR is a shift register whose input is determined by XORing some bits of the previous state. The bits that determine the next state are called "taps". LFSRs can produce random number sequences by varying the taps. They are well-suited for hardware but software implementations often suffer from inefficiency. Efficient LFSR implementations in software are important for cryptography. The document provides an example of an efficient C program that uses a 32-bit LFSR to encrypt text by XORing the LFSR output with each character.

Uploaded by

Vaishnavi Rave
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
110 views

Lfsr-Computer Networks

Linear feedback shift registers (LFSRs) are commonly used in cryptography. An LFSR is a shift register whose input is determined by XORing some bits of the previous state. The bits that determine the next state are called "taps". LFSRs can produce random number sequences by varying the taps. They are well-suited for hardware but software implementations often suffer from inefficiency. Efficient LFSR implementations in software are important for cryptography. The document provides an example of an efficient C program that uses a 32-bit LFSR to encrypt text by XORing the LFSR output with each character.

Uploaded by

Vaishnavi Rave
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

III.

LINEAR FEEDBACK SHIFT REGISTER


A Linear Feedback Shift Register is a shift register whose input state is a linear
function of its previous state. The simplest kindof feedback shift register is
a linear feedback shift register, or LFSR (as shown in Figure
1). The feedback function is simplythe XOR of certain bits in the register and th
e list of these bits is called a tap sequence. LFSRs are the most common typeof
shift registers used in cryptography because they can be used as random number
generators. Cryptographers like to analyzesequences to convince themselves
that they are random enough to be secure.
Figure 1
Feedback Shift Register LFSRs are the most common type of shift registers used in
Cryptography. The only linear functions of single bits are XOR andinverseXOR; thus it is a shift register whose input bit is driven by the exclusive-or
(XOR) of some bits of the overall shiftregister value. The initial value of LFSR
is called seed, the stream values produced by the register is completely
determined by previous state. It can produce various random sequences by
varying the taps [8], [11].The bit position that affects next state iscalled tap. This is
illustrated as follows
Figure 2
Feedback Shift Register LFSR design used for implementation Feedback register of length
m =8

LFSR mechanisms for each of the 7-bits in this circuit, at each


pulse, the state of the flip-flop is to the next one down the line
andalso computes Boolean function of the state of the flip-flops.
The sequence produced by LFSR with m flip-flops cannot
exceed2m-1. When the period is exactly 2m-1, the sequence is
called an m-sequences.
LFSRs are well-suited to hardware implementations, but their use in software programs
unfortunately often suffers from inefficient implementations. LFSRs with few taps, or

sparse LFSRs, are easier to use because you need calculate the XOR of only a few bits.
On the other hand, for cryptographic purposes, you must avoid sparse polynomials
because the resulting algorithms are easy to break. The C program in Listing 1 has the
advantage of implementing the XOR of a 32-bit integer with an efficient algorithm, thus
making an efficient way to implement the software of an LFSR. The program encrypts a
standard input into a standard output one character at a time. You use an LFSR to
generate eight random bits at a time, and the routine XORs the random bits to the
current character. The encryption key is a nonzero integer that you use as the initial
status of the register. The key is the same for both encoding and decoding. The variable
taps represent the 32 binary coefficients of a primitive polynomial of degree 31. Several
other choices are possible; Listing 1 suggests five of them in the comments. You can
safely remove the code that describes the number of characters encrypted and the
running time to make the program even smaller.

You might also like