0% found this document useful (0 votes)
12 views7 pages

L18-RC4, Pseudo Random Number Generator

The document provides an overview of the RC4 stream cipher, detailing its encryption and decryption processes using a pseudorandom number generator and X-OR operation. It explains the key-generation and key-scheduling algorithms, including how the state vector S is initialized and permuted. Additionally, it poses questions related to symmetric ciphers, public key cryptography, and the advantages of the RC4 algorithm.

Uploaded by

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

L18-RC4, Pseudo Random Number Generator

The document provides an overview of the RC4 stream cipher, detailing its encryption and decryption processes using a pseudorandom number generator and X-OR operation. It explains the key-generation and key-scheduling algorithms, including how the state vector S is initialized and permuted. Additionally, it poses questions related to symmetric ciphers, public key cryptography, and the advantages of the RC4 algorithm.

Uploaded by

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

CB 3491 – CRYPTOGRAPHY AND CYBER SECURITY

UNIT II
SYMMETRIC CIPHERS
L18
RC4,PSEUDO RANDOM NUMBER GENERATOR

By
Mrs.G.Saranya
AP/CSE
AAACET – DEPT OF CSE CB 3491 -CCS
RC4
 RC4 is a stream cipher and variable length key algorithm. This algorithm encrypts
one byte at a time (or larger units on a time).
 A key input is pseudorandom bit generator that produces a stream 8-bit number that
is unpredictable without knowledge of input key
 The output of the generator is called key-stream, is combined one byte at a time
with the plaintext stream cipher using X-OR operation.

Example:
RC4 Encryption
10011000 ⊕ 01010000 = 11001000
RC4 Decryption
11001000 ⊕ 01010000 = 10011000

AAACET – DEPT OF CSE CB 3491 -CCS


Key-Generation Algorithm

 A variable-length key from 1 to 256 byte is used to initialize a 256-byte state vector S,
with elements S[0] to S[255].

 For encryption and decryption, a byte k is generated from S by selecting one of the 255
entries in a systematic fashion, then the entries in S are permuted again.

Key-Scheduling Algorithm:

 Initialization: The entries of S are set equal to the values from 0 to 255 in ascending
order, a temporary vector T, is created.

 If the length of the key k is 256 bytes, then k is assigned to T. Otherwise, for a key with
length(k-len) bytes, the first k-len elements of T as copied from K and then K is
repeated as many times as necessary to fill T.
AAACET – DEPT OF CSE CB 3491 -CCS
for i = 0 to 255 do S[i] = i;
T[i] = K[i mod k - len];

we use T to produce the initial permutation of S. Starting with S[0] to S[255],


and for each S[i] algorithm swap it with another byte in S according to a scheme
dictated by T[i], but S will still contain values from 0 to 255 :

j = 0;
for
i = 0 to 255 do
{
j = (j + S[i] + T[i])mod 256;
Swap(S[i], S[j]);
}

AAACET – DEPT OF CSE CB 3491 -CCS


Pseudo random generation algorithm (Stream Generation):

 Once the vector S is initialized, the input key will not be used. In this step, for each
S[i] algorithm swap it with another byte in S according to a scheme dictated by the
current configuration of S.

 After reaching S[255] the process continues, starting from S[0] again

i, j = 0;
while (true)
i = (i + 1)mod 256;
j = (j + S[i])mod 256;
Swap(S[i], S[j]);
t = (S[i] + S[j])mod 256;
k = S[t];
AAACET – DEPT OF CSE CB 3491 -CCS
QUESTIONS

1. What is a symmetric cipher?

2. What is a public key cryptography?

3. What is RC4 algorithm?

4. What is the advandages of RC4?

5. What is avalanche effect?

AAACET – DEPT OF CSE CB 3491 -CCS


THANK YOU…

AAACET – DEPT OF CSE CB 3491 -CCS

You might also like