You are on page 1of 13

Department of Software

The University of Babylon

LECTURE NOTES ON Steam Cipher System


By Dr. Samaher Hussein Ali
College of Information Technology, University of Babylon, Iraq Samaher_hussein@yahoo.com

10/24/2012

Stream Cipher System ki


Key Generator

Feedback Shift Register( Linear or non Linear Function)

Ci
Binary Sequence of cipher text

Letter

Plain Text Binary Sequence Generator

Pi

Key Generator: is part of stream cipher system that is responsible on generating of a long random sequence of binary key that used in ciphering and deciphering process Feedback Shift Register used the Linear or Non-linear functions to mix the plain text with the key 1. Linear Feedback Shift Register (XOR) 2. Nonlinear Feedback Shift Register (And , Or)

10/24/2012

Dr. Samaher Hussein Ali

Notes of Lecture 6

Stream Cipher System


Max Length of Key=2 1

where n number of state

Number of Correct Connection= Logic of XOR

(2 1 )

Example: Let the initial State of Sift Register is {0, 1, 0} and Feed Back coefficient 1011 find States, then cipher the massage GOOD

X1 0 1 0 1

X2 0 0 1 1

Output 0 1 1 0

+
C3=1

0
C0=1
C1=0

1
C2=1

0
S2

S0

S1

10/24/2012

Dr. Samaher Hussein Ali

Notes of Lecture 6

Stream Cipher System


Max Length of Key=2 1 = 7
3

No

FB

S0 0

S1 1
0 1 1 1 0 0 1

S2 0
1 0 1 1 1 0 0

Output

1 2 3 4 5 6 7

1 1 0 0 1 0

1 1 1 0 0 1 0

0 1 0 1 1 1 0

Key = 0101110

10/24/2012

Dr. Samaher Hussein Ali

Notes of Lecture 6

Stream Cipher System


Initial State

4 1

2
7- States

5 6 7

3
Message = GOOD G= 7= 0111 O= 15=1111 O= 15= 1111 D= 4 = 0100 PLAIN TEXT = 0111 1111 1111 0100 KEY = 0101 1100 1011 1001

10/24/2012

Dr. Samaher Hussein Ali

Notes of Lecture 6

Stream Cipher System


Example: Let the initial State of Sift Register is {1,0, 1, 0} and Feed Back coefficient 10011 find States, then cipher the massage Happy New Year

+
C4=1

C0=1

1
S0
C1=0

0
C2=0

1
C3=1

0
S3

Max Length of Key=2 1 = 15 No


1 2 3 4 5 6 10/24/2012

S1

S2

FB
1 1 0 0 0 1

S0 1
1 1 1 0 0 0

S1 0
1 1 1 1 0 0

S2 1
0 1 1 1 1 0

S3 0
1 0 1 1 1 1

Output
0 1 0 1 1 1

Dr. Samaher Hussein Ali

Notes of Lecture 6

Stream Cipher System


No 7
8 9 10 11 12 13 14 15

FB
0 0 1 1 0 1 0 1 1

S0
1 0 0 1 1 0 1 0 1

S1
0 1 0 0 1 1 0 1 0

S2
0 0 1 0 0 1 1 0 1

S3
0 0 0 1 0 0 1 1 0

Output
1 0 0 0 1 0 0 1 1

Key = 01011 11000 10011 Message = Happy New Year H= 8= 1000 r= 18 = 1010

10/24/2012

Dr. Samaher Hussein Ali

Notes of Lecture 6

Stream Cipher System ( Nonlinear Feedback Shift Register )


One general technique for destroying the linearity inherent in LFSRs is to use several LFSRs in parallel. The keystream is generated as a nonlinear function F of the outputs of the component LFSRs; this construction is illustrated in Figure 1. Such keystream generators are called nonlinear combination generators, and F is called the combining function. The remainder of this subsection demonstrates that the function F must satisfy several criteria in order to withstand certain particular cryptographic attacks.

Figure 1: A nonlinear combination generator. F is a nonlinear combining function. (Geffe Generator) The Geffe generator, as depicted in Figure 2, is defined by three maximum-length LFSRs whose lengths L1,L2, and L3 are pairwise relatively prime, with nonlinear combining function

The keystream generated has period

10/24/2012

Dr. Samaher Hussein Ali

Notes of Lecture 6

Stream Cipher System ( Nonlinear Feedback Shift Register NLFSR )


and linear complexity

Figure 2: The Geffe generator.

10/24/2012

Dr. Samaher Hussein Ali

Notes of Lecture 6

Stream Cipher System ( Nonlinear Feedback Shift Register )


Logic of AND X1 0 1 0 1 X1 0 1 0 1 X2 0 0 1 1 X2 0 0 1 1 Output 0 0 0 1 Output 0 1 1 1

Logic of OR

LFBSR1

X1

Nonlinear Function
X2

LFBSR2

10/24/2012

Dr. Samaher Hussein Ali

Notes of Lecture 6

Stream Cipher System ( Nonlinear Feedback Shift Register ) + 1


C3=1
C2=0

0
C1=1

1
C0=1

X1

S3

S2

S0

AND O/P

X2

+ 1
S3
C3=1

C4=1

1
C2=0

1
C1=0

0
C0=1

S2

S1

S0

10/24/2012

Dr. Samaher Hussein Ali

Notes of Lecture 6

Stream Cipher System ( Nonlinear Feedback Shift Register NLFSR )

No

FB

S2

S1

S0

0/P

FB

S3

S2

S1

S0

O/P

Output

1
1 2 3 4 5 6 7 8 9 10 11 0 1 1 1 0 1 0 0 0 1 1 1 0 1

0
1 0 0 1 1 1 0

1
0 1 0 0 1 1 1 1 0 1 0 0 1 1 1 0 1 0 0 1 0 1 1 0 0 1 0 0 0

1
1 0 1 0 1 1 0 0 1 0 0

1
1 1 0 1 0 1 1 0 0 1 0

1
1 1 1 0 1 0 1 1 0 0 1

0
1 1 1 1 0 1 0 1 1 0 0 0 1 1 1 1 0 1 0 1 1 0 0 0 0 0 1 0 1 0 0 1 0

10/24/2012

Dr. Samaher Hussein Ali

Notes of Lecture 6

Stream Cipher System ( Nonlinear Feedback Shift Register NLFSR )

No 12 13 14 15

FB

S2

S1

S0

0/P 0 1 1 1

FB 1 1 1

S3 0 1 1 1

S2 0 0 1 1

S1 0 0 0 1

S0 1 0 0 0

O/P 0 1 0 0

Output

0
1 0 0

Key = 00001 01001 00100

10/24/2012

Dr. Samaher Hussein Ali

Notes of Lecture 6