Download as pdf or txt
Download as pdf or txt
You are on page 1of 5

Performance Analysis of Maximum Length LFSR

and BBS Method for Cryptographic Application


N.S.Abinaya P.Prakasam
PG Scholar, VLSI Design Dept. of Electronics and Communication Engineering
Tagore Institute of Engineering and Technology Tagore Institute of Engineering and Technology
Attur- 636 1 12, Tamil Nadu, India Attur- 636 1 12, Tamil Nadu, India
abinaya.ns001@gmail.com prakasamp@gmail.com

Key Key
Abstract- Today cryptography is an integral part of our
lives. PRNG's are used in modern cryptography. The
maximal length PN-sequence (m-sequence) is the best known
best-described PN-sequence whose length is equal to its
period. Various PN-codes can be generated using Linear
Feedback Shift Register (LFSR). The generator polynomial
Stream Stream
provides the necessary feedback taps for the LFSR circuit.
The implementation of the LFSR circuit with VLSI Cipher Cipher
technology makes it useful in low-power communication
system design. This paper presents the performance
comparison of 4 bit LFSR method with BBS and the reported
results show that LFSR is more suitable for cryptographic Plaintext Plaintext
application.

Cipher text
Index terms - Cryptography, Linear Feedback Shift
Register, and Low power VLSI. Figure 1 Fundamental of Cryptography

I INTRODUCTION In this paper, 8, 16 and 32 bit maximum length LFSR


In modern world, Cryptographic systems have become which can give the maximum states of PN sequence has
a part of our daily life due to the need of security of many been implemented. Also presented the comparison of
common activities such as communication, payments, data performance analysis of 4 bit LFSR and 16 bit BBS based
transfers etc. Rapid expansion of internet and wireless on synthesis and simulation result on FPGA using
based communications. Cryptography provides the support hardware descriptive language(HDL) with maximum
to design the necessary data protection services. The length feedback polynomial to understand the area, speed
fundamental of cryptography is illustrated in Fig l. Hence and power requirement. The target device we have used is
this has been attracted by many researchers in recent past. Xilinx Virtex6 XA9572XL FPGA and performed
The best support in design and implementation of simulation and synthesis using Xilinx ISE 12.l. FPGA is a
cryptographic applications is offered by embedded predesigned reconfigurable Ie. It has the ability to
systems such as ASICs and FPGAs [1].FPGA is more reconfigure its circuitry for a desired application or
suitable because of its re-configurability and better function at any time after manufacturing. It is an adaptive
performance. PRNGs are used for modern cryptography hardware that continuously changes in response to the
applications [1], [2].Cryptography is the science of secret input data or processing environment. The FPGA
writing. A cipher is a secret method of writing; where by configuration is generally defmed using a hardware
plain text is transformed into a cipher text. Encryption and description language (HDL), similar to circuit
decryption are controlled by cryptographic keys. (ASIC).FPGAs can be used to implement any logical
Linear feedback shift registers as maximal length function that an ASIC can perform. Because of various
sequence generators are widely used in stream ciphers for advantages and rapid prototype development can possible,
key stream generation due to their good statistical so FPGA is chosen.
properties, large period, and low implementation costs, The remainder of the paper is organized as follows:
and are readily analyzed using algebraic techniques. Section II focuses on the literature review related with
Maximal length sequences are generated when the LFSR various methods. Section III emphasizes on analysis of
passes through every non-zero state once and only once data collection related to reported techniques. Section IV
and are obtained when the feedback polynomial to which focuses the performance analysis of the same and Section
LFSR corresponds is primitive [3], a feedback polynomial V reports the conclusion of the research work.
of degree n is primitive if it is irreducible (cannot be
factored) and has a period equivalent to 2"-1.
compared with LFSR method alone. Security increased as
II LITERATURE REVIEW number of bits increased in LFSR.
LFSR in CDMA application [8] PN sequence
A .Blum Blum shub sequence generator (BBS) generation is considered to be the heart of CDMA system.
The comparative study between BBS and LFSR PN The maximum length PN sequence is described as best PN
Sequence Generator [1] LFSR is periodic were as BBS sequence. Currently CDMA uses Gold codes for PN
method is a non-periodic PRNG. The feedback shift sequence. Gold codes are formed by combining two PN
register permits very fast generation of PN sequence.4 bit sequences which require more hardware area. The role of
LFSR can generate 15-bit sequence with maximum length feedback taps in LFSR is very important in the design of
polynomial. But only 16-bit BBS can generate 16-bit low power communication system. Selection of higher
sequence. CPU time is taking for 4-Bit LFSR is 0.39 sec length of LFSRs with feedback gives much better
whereas for BBS it is 4.11 sec. Number of flip flop attributes in comparison with the selection of lower
required for LFSR is 4 and in BBS, it is 16. Hence, lengths of the LFSRs. Secure transmission of message
memory utilization is more in BBS. using LFSR [9] method increases the security of the
Blum Blum Shub was the pseudo random number transmission over an unsecured channel. LFSR is a good
generator proposed in 1986 by Lenore Blum, Manuel function to generate RNs because logical circuit variations
Blum, and Mike shub. It have presented two pseudo­ are high. Software and hardware implementation of LFSR
random number sequence generators and discussed their is very easy. The Revisiting LFSRs [10] describes the 2
properties [4], [5].They are, types LFSMs Galosis LFSR and Fibonacci LFSR,
(1) The 1 IP generator-predictable. - The galosis LFSR also known as internal
(2) The x2 mod N generator - unpredictable. XOR LFSR or canonical LFSR.
The liP generator has applications to the generation of - The Fibonacci LFSR also known as
generalized maximum-length shift-register sequences. external XOR LFSR or just LFSR.
Thex2modNgenerator has applications to public-key

�-- - - �
cryptography. "./ J
11-2 0

B. LFSR sequence generator


This application note [6] describes 4- and 5-bit
universal LFSR counters, very efficient RAM-based 32-bit
and 100-bit shift registers, and pseudo-random sequence Figure 2 Galosis LFSR
generators with repetition rates of thousands and even
trillions of years, useful for testing and encryption
purposes. The appropriate taps for maximum-length LFSR
counters of up to 168 bits are listed.
The multi-bit LFSR PNRG and performance
comparison [1].The analysis is restricted to fmd number
gates, memory and speed requirement in FPGA as the
number of bits is increased. Tapping is the main function
for generating PNRG. In this only one tapping (one XOR
operation) is used.8bit, 16bit, 32bit with single tapping has Figure 3 Fibonacci LFSR

been generated only 63,255 and 2046 random output


instead of 255, 65535 and 4,29,49,67,295.By increasing Fig 2 and 3 represents about the Galosis LFSR and
the tapping in future, more random output sequence may Fibonacci LFSR respectively. Galois LFSRs do not
be generated. With maximum length feedback polynomial concatenate every tap to produce the new input (the
[7] produces the long sequence of pattern generation for XOR'ing is done within the LFSR and no XOR gates are
cryptography. More secure than that of minimum length run in serial, therefore the propagation times are reduced
feedback polynomial.8 bit LFSR with maximum feedback to that of one XOR rather than a whole chain), thus it is
16
generates 28-1=255 random outputs.16 bit generates 2 _ possible for each tap to be computed in parallel, increasing
32
1=65535.32 bit generates 2 _1 =429,49,67,295.Cipher the speed of execution. In a software implementation of an
based LFSR and modular division circuit[9]Polynomial LFSR, the Galois form is more efficient as the XOR
modular division is combined with LFSR generator to operations can be implemented a word at a time: only the
yield stream generator with much higher periodicity. output bit must be examined individually.
Among various possible stream ciphers LFSR is more
popular. Simple structures and low hardware cost. C. Mersenne Twister algorithm

Modular division is used to increase the periodicity. By The true random number generation using Mersenne
combining both LFSR and Modular Division circuit Twister algorithm has been presented [11]. In this paper,
throughput of the system is increased by 2"_1 times as design and implementation of a parallel implementation
has been done using FPGA, CPU and GPU. Resource
utilization is 128slices and 193 FFs for 32bit word length. polynomial must be 1's or O's. This is called the feedback
And also it has been reported that FPGA based polynomial or characteristic polynomial. For example, in 4
implementation can achieve 25x speed-up compared with bit LFSR if the taps are at the 4th and 3rd bits (as shown),
CPU and 9x with GPu. High performance mersenne then the feedback polynomial is
twister [12] reported that the fast generation of very high X4+X3+1
quality PRN using LFSR. The performance of proposed
algorithm required only330 slices and 539LUTs for 32 1) The Rules for Selecting Feedback Polynomial:
bit word length. The rules for selecting feedback polynomial which is
D. Digital map approach given in [1], [7] are as follows:
The digital maps [13] for PRNGs and also compared 1. The 'one' in the polynomial does not correspond to
this with LFSR PRNGs. Digital map approach is the non­ a tap it corresponds to the input to the first bit (i.e.
periodic approach with Complex circuit this approach is Xo which is equivalent to 1).

not able to reduce or simplify the polynomials. LFSR is 2. The powers of the terms represent the tapped bits,
low circuit complexity, low power dissipation and capable counting from the left. The first and last bits are
of generating PRS at high bit rate. Logistic digital map always connected as an input and output tap
required at least 30 bit to achieve above 20,000 period respectively.
sequences, only 15bit LFSR enough to generate the same 3. The LFSR will only be maximum-length if the
sequence. number of taps is even; just 2 or 4 taps can suffice
even for extremely long sequences.
III. ANALYSIS OF DATA COLLECTION 4. The set of taps taken all together, not pair wise (i.e.
as pairs of elements) must be relatively prime. In
A.BBS Method other words, there must be no common divisor to all
DEFINITION (liP generator): lip generator is taps.
completely predictable and one can infer the 'seed' and 5. Once one maximum-length tap sequence has been
continue the sequence backwards and forwards. To defme found, another automatically follows. If the tap
the seed space, let N = {integers P>1 relatively prime to b} sequence, in an n-bit LFSR is [n, A, B, C, 0],
be the parameter values, and let the seed domain X be the where the 0 corresponds to the xO = 1 term, then the
disjoint union. corresponding 'mirror' sequence is [n, n -C, n -B, n
DEFINITION [x2 mod N generator]: X2 mod N -A, 0]. So the tap sequence [32, 7,3, 2, and 0] has as
generator is unpredictable and one can generate the its counterpart [32, 30, 29, 25, 0]. Both give a
sequence forward and one cannot generate the sequence maximwn-Iength sequence.
backward. Let N= {integers NIN= P*Q, such that P, Q are
equal length (IPI=IQI) distinct primes 3 mod 4} be the set TABLE I. POSSIBLE AND MAXIMUM LENGTH
POLYNOMIAL
of parameter values.
Size of Possible feedback Maximum
B. Basic models analysis of LFSRs LFSR Polynomial length

LFSR is a shift register whose input bit is a linear feedback


polynomial
function of its previous state. The most commonly used
4bit
linear function of single bits is XOR. Thus, an LFSR is a X4+X2+I,X4+X3+I etc., X4+X2+1

shift register whose input bit is driven by the exclusive-or 8bit


X8+X' + I,X8+X5+ I, X8+X' +X6+
(XOR) of some bits of the overall shift register value. [14]. X; + I
The initial value of the LFSR is called the seed. Because X8+X' +X6+X5+ I,

the register has a fmite number of possible states, it must 4 3 l


X8+X6+X +X +X2 +X + I,Etc.,
eventually enter a repeating cycle. However, an LFSR 16bit
XI6 +X15+ I, X16 +X14+XIJ
with a well-chosen feedback function can produced +X"++ I
9
sequence of bits which appears random and which has a XI6 +XIJ +XI2 +X + I,

very long cycle. Applications of LFSRs include generating X16+X"+XIO +X'+X3+Xl+ I,


pseudo-random numbers, pseudo-noise sequences, fast '
XI6 +X15+Xl" +XI2+X +X6+
digital counters, and whitening sequences. Both hardware
3
and software implementations of LFSRs are common [9]. +X +X2+ I, etc.,
32bit
The bits in the LFSR state which influence the input X32+X31+ 1, X32+X22+X2
are called taps. A maximum-length LFSR produces an m­ 9 +XI+ I
X32 8
+X2 +X27 +X + I,
sequence (i.e. it cycles through all possible 2n-1 states
X32+X21+X15+X13+X12+XIO+
within the shift register except the state where all bits are
X8+X4 + I,
zero), unless it contains all zeros, in which case it will
never change. . The arrangement of taps for feedback in an X32+X3I+X27 +X24 +XI9+XIS
4 5
LFSR can be expressed in finite field arithmetic as a +XI7 +X1 +XIJ +X"+X +X"+
X " etc.,
polynomial mod 2. This means that the coefficients of the
IV. RESULTS AND DISCUSSION
The most commonly used linear function of single bits
is XOR. Thus, an LFSR is most often a shift register The comparison between 4 bit LFSR and BBS method
whose input bit is driven by the exclusive-or (XOR) of has been carried out for further analysis. This has been
some bits of the overall shift register value. [2], [14]. The illustrated in Table II. The generated 15 bit sequence of 4-
4-bit Fibonacci LFSR and PN Sequence for 4bit Fibonacci bit LFSR is taking 1260ns simulation time at 20ns clock
LFSR is shown in Fig 4 and 5 respectively. The initial cycle whereas 16-bit BBS generates sequence after 450ns
value of the LFSR is called the seed. Because the register on the single clock cycle. It can be observed the sequence
has a finite number of possible states, it must eventually is repeating after 15 clock periods in LFSR where as in
enter a repeating cycle. However, an LFSR with a well­ BBS after 15 clock period another random bit generate.
chosen feedback function can produce sequence of bits Total number of random state generating in 4 bit LFSR is
which appears random and which has a very long cycle. 15, for same random states in BBS it required 16 bit .
Applications of LFSRs include generating pseudo-random Table II shows that in LFSR as compared with BBS,
numbers, pseudo-noise sequences, fast digital counters, number of shift register required and number of flip flops
and whitening sequences. Both hardware and software utilized has been found very low. Hence, this consumed
implementations of LFSRs are common [1]. less power.

fT,� TABLE II. COMPARISON BETWEEN LFSR AND BBS


\ 1 '-"

PERFORMANCE 4 BIT LFSR 16 BIT BBS
Time to complete the 20ns to It takes only
total states 1280ns=1260 Ins,after 450ns
� � � -�
Total no. of random
FFI FF2 FF3 FF3 15 16
states generating

P P P Clock 20ns 20ns

Shift Register 04 one bit One 16 bit

Number of slices 02 00

No. oftlip-tlops 04 16

elk CPU time 0.39sec. 4. l lsec.


Figure4. 4-bit Fibonacci LFSR
Total pins 06 18

A maximal-length LFSR produces the maximum


number of PRPG and has a pattern count equal to 2" - The synthesis and simulation report for 8bi LFSR by
l.The initial value of the LFSR - Seed. LFSR with a well­ using maximum length feedback polynomial and
chosen feedback function can produce a better sequence of minimum length feedback polynomials are given in Table
bits, appears random in nature& which has a very long III. Form the table we can find the total memory usage,
cycle. LFSR is a shift register whose input bit is a linear total number of random states generating and simulation
function of its previous state. time of different length LFSR.

TABLE III.COMPARISON BETWEEN 8 BIT MTNTMUN AND


MAXIMUM LENGTH FEEDBACK LFSR

MINIMUM MAXIMUM
PERFORMANCE LENGTH LENGTH
FEEDBACK FEEDBACK

Time to complete the 20 ns to 1280 ns 40 ns to 5140


total states =1260 ns ns=5100 ns

Total no. of Random


63 255
States generating

Clock 20ns 20ns

Shift Register 8 8

Xor gate 01 01

No. of Slice Flip Flops 08 08

Total memory usage 185904 kb 185904 kb

GCLK 01 01
FigureS. PN Sequence for 4bit Fibonacci LFSR
Total pin 10 10
From the above TABLEIII it is clear that by using
[9]. Dr.AshishNegi, Jayveer Singh Farswan,
maximum length feedback LFSR increases the total
V.MThakkar, SiddharthGhansala "Cryptography Play fair Cipher
random output states than that of minimum length using Linear Feedback Shift Register", IOSR Journal of
feedback LFSR. Engineering May. 2012, Vol. 2(5) pp: 1212-1216.
[10]. Arnault. F, Berger. T, Minier. M and Pousse. M, "Revisiting
LFSRs for cryptographic applications", IEEE Transactions on
V. CONCLUSION
Information Theory, Vol. 57, No. 12, Dec 2011, pp.8095-8113.
[II]. Xiang Tian and KhaledBenkrid, "Mersenne Twister Number
This paper described the BBS method, LFSR sequence Generation on FPGA, CPU and GPU",Proc. Of NASAIESA
generator, Mersenne Twister algorithm and Digital map Conference on Adaptive Hardware and Systems, 2009, pp.460-
464.
approach for cryptographic application. The performance
[12]. ShrutisagarChandrasekaran and Abbes Amira "High Performance
analysis of BBS technique and 4 bit LFSR has been FPGA implementation of the Mersenne Twister", Proc. Of 4th
simulated and compared. As compared with BBS method, IEEE International Symposium on Electronic Design, Test &
LFSR utilized less number of flip flops and also shift Application, Jan 2008, pp.482-485.
[13]. Massimo Alioto, Simone Bernardi, Ada Fort, Santina Rocchi,
register. Hence it has been observed that it consumes less
Valerio Vignoli, "On the Suitability of Digital Maps for Integrated
power. And also selection of higher lengths of LFSRs with Pseudo-RNGs", Proc. Of ECCTD'03 - European Conference on
feedback gives much better attributes in comparison with Circuit Theory and Design, September 1-4, 2003, Cracow, Poland,
the selection of lower length of the LFSRs. pp.349-352.
[14]. Goresky, M.; Klapper, A.M.; Fibonacci and Galois representations
of feedback-with-carry shift registers, "IEEE Transactions on
REFERENCES Information Theory", Vol. 48, Issue II, Nov 2002, pp.2826-2836.
[15]. Deepthi P.P. and P.S. Sathidevi "Hardware Stream Cipher Based
[I]. KhushbooSewak, Panda Amit K, Rajput P, "FPGA Implementation on LFSR and Modular Division Circuit", International Journal of
of 16 bit BBS and LFSR PN Sequence Generator: A Comparative Electrical and Computer Engineering 3:12 2008.
Study", In Proc. of the IEEE Student Conference on Electrical, [16]. Elena Dubrova "A List of Maximum Period NLFSRs", Royal
Electronics and Computer Sciences 2012, 1-2 Mar 2012, NIT Institute oITechnology (KTH), Forum 120, 164 40 Kista, Sweden,
Bhopal, India, pp. 1-3. pp.I-9.
[2]. Panda Amit K, Rajput P, Shukla B, "Design of Multi Bit LFSR [17]. AlexandruComan, RaduFratila, "Cryptographic Applications
PNRG and Performance comparison on FPGA using VHDL", using FPGA Technology"Journal of Mobile, Embedded and
International Journal of Advances in Engineering & Distributed Systems, vol. lll, no. 1, 2011, pp. 10-16.
Technology(IJAET), Mar 2012, Vol. 3, Issue 1, pp. 566-571. [18]. KaustubhGawande,MaithilyMundle"Variouslmplementations of
[3]. Sun Jing, Yang jing-yu, Fu De-sheng: Research On the Security of Blum BlumShubPseudo-Random Sequence
Key Generator in Stream Ciphers: The 1st International Conference enerator"http:lcs.ucsb.edul-koclaclprojectI2003Igawande­
on information Science and engineering (ICISE2009) pp. 1831- mundle.pdJ
83. [19]. Lecuyer, Pierre, "Tables of Linear Congruential Generators of
[4]. Lenore Blum, Manuel Blum, Mikeshub, "A Simple unpredictable DifferentSizes and Good Lattice Structure," Mathematics of
pseudo random number generator", SIAM Compute 0111986. Computation, Vo1.68, No. 225, 1999, pp. 249-260.
[5]. M.Luby, Pseudo randomness and Cryptographic Applications,
Princeton Computer Science Notes, 1996.
[6]. Efficient Shift Registers, LFSR Counters, and Long Pseudo­
Random Sequence Generators, Application Note,Xilinx Inc.
[7]. Amit Kumar Panda*, Praveena Rajput, BhawnaShukla, "FPGA
Implementation of 8, 16, and 32 bit LFSR with Maximum length
feedback polynomial using VHDL", Proc. Of International
Conference on Communication Systems and Network
Technologies, 2012, pp.769-773.
[8]. Afaq Ahmad "Better PN Generators for CDMA Application - A
Verilog-HDL Implementation Approach", International Journal of
Information Engineering (IJlE) Vol.2, No.1, Mar. 2012, pp. 6-11.

You might also like