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

Rc4stream Cipher

The document discusses RC4 stream cipher method. It notes that RC4 was an early and widely used stream cipher that operated by generating a pseudorandom key bit stream to encrypt plaintext [1]. It was commonly used to secure Internet protocols and applications like SSL/TLS [2]. RC4 was known for its simplicity and fast encryption/decryption speeds [3].

Uploaded by

Devendra Thawari
Copyright
© © All Rights Reserved
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
58 views

Rc4stream Cipher

The document discusses RC4 stream cipher method. It notes that RC4 was an early and widely used stream cipher that operated by generating a pseudorandom key bit stream to encrypt plaintext [1]. It was commonly used to secure Internet protocols and applications like SSL/TLS [2]. RC4 was known for its simplicity and fast encryption/decryption speeds [3].

Uploaded by

Devendra Thawari
Copyright
© © All Rights Reserved
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 11

Presentation on

RC4 Stream Cipher Method

By
Devendra Thawari.
B.Tech CE,Diploma Computer
Engineering
RC4 Stream Cipher Method

1. Early Cryptographic Innovation: RC4 was one of the first


widely-used stream ciphers, which operate by generating a
continuous stream of pseudorandom key bits to encrypt
plaintext. Its development represented an important
milestone in the evolution of cryptography.
2. Internet Security: RC4 was commonly used in various
Internet protocols and applications, including SSL/TLS
(Secure Sockets Layer/Transport Layer Security), which are
essential for securing web communications. It played a
significant role in securing online transactions, web
browsing, and data transfer.
3. Simplicity and Speed: RC4 was known for its simplicity in
implementation and its relatively fast encryption and
decryption speeds.
Key Scheduling :
 j=0;
 For i=0 to 255 do
 j=( j + s[ i ] + k[ i ]) mod 256;
 Swap( s[ i ] , s[ j ] );
 End for
 repeat the above process till key length
Key Stream Generator :

 I = 0 , j = 0;
 I =( i +1 ) mod 256
 j =( j + s[ i ] ) mod 256
 Swap(s[ i ], s[ j ] )
 t=( s[ i ]+s[ j ] )mod 256
 Key stream=s[ t ]
 repeat the above process till plain text length
Question:
 Show the encryption & decryption process with the given
example.
 State array, S of length 8 be = [ 7 6 5 4 3 2 1 0 ] Key,
 K=[1368]
 Plain Text, PT = [ 2 6 5 8 ]
Solution:
Key scheduling :
s[7,6,5,4,3,2,1,0]
k[1,3,6,8] extending the k as s lenght
PT=[2,6,5,8]
Round 1:
 j=0; i=0
 j=( j + s[ i ] + k[ i ]) mod 8;
 =( 0 + s[ 0 ] + k[ 0 ]) mod 8;
 =( 0+ 7 + 1) mod 8;
 j=0
 Swap( s[ i ] , s[ j ] );
 =( s[ 0] , s[ 0 ] )
 s[7,6,5,4,3,2,1,0]
Round 2: Round 3:
i=1 j=0 i=2 j=1;
j=( j + s[ i ] + k[ i ]) mod 8; j=( j + s[ i ] + k[ i ]) mod 8;
=( 0 + s[ 1 ] + k[ 1 ]) mod 8; =( 1 + s[ 2 ] + k[ 2 ]) mod 8;
=( 0+ 6 + 3) mod 8; =( 1+ 5 + 6) mod 8;
j=1 j=4
Swap( s[ i ] , s[ j ] ); Swap( s[ i ] , s[ j ] );
=( s[ 1] , s[ 1 ] ) =( s[ 2] , s[ 4 ] )
s[7,6,5,4,3,2,1,0] s[7,6,3,4,5,2,1,0]

Round 4: Round 5:
i=3; j=4 i=4; j=0
j=( j + s[ i ] + k[ i ]) mod 8; j=( j + s[ i ] + k[ i ]) mod 8;
=( 4 + s[ 3 ] + k[ 3 ]) mod 8; =( 0 + s[ 4 ] + k[ 4 ]) mod 8;
=( 4+ 4 + 8) mod 8; =( 0+ 5 + 1) mod 8;
j=0 j=6
Swap( s[ i ] , s[ j ] ); Swap( s[ i ] , s[ j ] );
=( s[ 3] , s[ 0 ] ) =( s[ 4] , s[ 6 ] )
s[4,6,3,7,5,2,1,0] s[4,6,3,7,1,2,5,0]
Round 6: Round 7:
i=5; j=6 i=6; j=3
j=( j + s[ i ] + k[ i ]) mod 8; j=( j + s[ i ] + k[ i ]) mod 8;
=( 6 + s[ 5 ] + k[ 5 ]) mod 8; =( 3+ s[ 6 ] + k[ 6 ]) mod 8;
=( 6+ 2 + 3) mod 8; =( 3+ 5+ 6) mod 8;
j=1 j=6
Swap( s[ i ] , s[ j ] ); Swap( s[ i ] , s[ j ] );
=( s[ 5] , s[ 3 ] ) =( s[ 6] , s[ 6 ] )
s[4,6,3,2,1,7,5,0] s[4,6,3,2,1,7,5,0]

Round 8:
i=7; j=6
j=( j + s[ i ] + k[ i ]) mod 8;
=( 6 + s[ 7 ] + k[ 7 ]) mod 8;
=( 6+ 40+ 8) mod 8;
j=6
Swap( s[ i ] , s[ j ] );
=( s[ 7] , s[ 6 ] )
s[4,6,3,2,1,7,0,5]
Key stream Generator

Iteration 1: Iteration 2:
i = 0 , j = 0; i = 1 , j = 6;
i=( i +1 ) mod 8 i =( i +1 ) mod 8
=( 0 +1 ) mod 8=1 =( 1 +1 ) mod 8=2

j =( j + s[ i ] ) mod 8 j =( j + s[ i ] ) mod 8
=( 0+ s[ 1] ) mod 8 =( 6+ s[ 2] ) mod 8
=( 0 + 6) mod 8 =6 =( 6 + 3) mod 8 =1

Swap(s[ i ], s[ j ] ) Swap(s[ i ], s[ j ] )
Swap(s[ 1], s[ 6 ] ) Swap(s[ 2], s[ 1 ] )
S=[4, 0 ,3,2,1,7,6,5]
S=[4, 3 ,0,2,1,7,6,5]
t=( s[ i ]+s[ j ] )mod 8
=( s[ 1]+s[ 6 ] )mod 8 t=( s[ i ]+s[ j ] )mod 8
=( 0+6)mod 8=6 =( s[ 2]+s[ 1 ] )mod 8
=( 0+3 )mod 8=3
Key stream=s[ t ]=s[6]=6
Key stream=s[ t ]=s[3]=2
Iteration 3: Iteration 4:
i= 2 , j = 1; i= 3 , j = 3;
i =( i +1 ) mod 8 i =( i +1 ) mod 8
=( 2 +1 ) mod 8=3 =( 3+1 ) mod 8=4

j =( j + s[ i ] ) mod 8 j =( j + s[ i ] ) mod 8
=( 1+ s[ 3] ) mod 8 =( 3+ s[ 4] ) mod 8
=( 1 + 2) mod 8 =3 =( 3 + 1) mod 8 =4

Swap(s[ i ], s[ j ] ) Swap(s[ i ], s[ j ] )
Swap(s[ 3], s[ 3 ] ) Swap(s[ 4], s[ 4 ] )

S=[4, 3 ,0,2,1,7,6,5] S=[4, 3 ,0,2,1,7,6,5]

t=( s[ i ]+s[ j ] )mod 8 t=( s[ i ]+s[ j ] )mod 8


=( s[ 3]+s[ 3 ] )mod 8 =( s[ 4]+s[ 4 ] )mod 8
=( 2+2 )mod 8=4 =( 1+1 )mod 8=2

Key stream=s[ t ]=s[4]=1 Key stream=s[ t ]=s[2]=0


B – is the minimum of rewards of true best arm in Sl+1��+1, i.e. in l+1th�+1�ℎ phase
A – is the minimum of rewards of true best arm in Sl��, i.e. in lth��ℎ phase
– is the maximum of rewards of true best arm in Sl+1��+1, i.e. in l+1th�+1�ℎ phase
B – is the maximum of rewards of true best arm in Sl��, i.e. in lth��ℎ phase
h of the statements above are correct?

Encryption: Decryption:

CT=PT XOR K PT=CT XOR K


PT=[2,6,5,8] CT=[4,4,4,8]
K=[6,2,1,0] K=[6,2,1,0]

pt 0010 0110 0101 1000 pt 0100 0100 0100 1000


xor
k 0110 0010 0001 0000 xor
0110 0010 0001 0000
k
0100 0100 0100 1000
0010 0110 0101 1000
CT=[4,4,4,8]
PT=[2,6,5,8]

You might also like