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

Stream Cipher

Here is a summary of the key points about stream ciphers: - Stream ciphers are a type of symmetric encryption algorithm that encrypts plaintext digits one byte at a time using a pseudorandom keystream. - The keystream is generated from a small secret key using a pseudorandom number generator. - Encryption is performed using a simple XOR operation between the plaintext and keystream. - Stream ciphers are often used for real-time encryption of data streams like voice calls or video chats due to their fast encryption/decryption speed. - Examples of stream ciphers include RC4, SEAL, and Salsa20. RC4 is one of the most widely used stream ciphers

Uploaded by

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

Stream Cipher

Here is a summary of the key points about stream ciphers: - Stream ciphers are a type of symmetric encryption algorithm that encrypts plaintext digits one byte at a time using a pseudorandom keystream. - The keystream is generated from a small secret key using a pseudorandom number generator. - Encryption is performed using a simple XOR operation between the plaintext and keystream. - Stream ciphers are often used for real-time encryption of data streams like voice calls or video chats due to their fast encryption/decryption speed. - Examples of stream ciphers include RC4, SEAL, and Salsa20. RC4 is one of the most widely used stream ciphers

Uploaded by

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

STREAM CIPHER

Stream cipher
A stream cipher is a type of symmetric encryption
algorithm. A stream cipher makes use of a much
smaller and more convenient key — 32 bits, for
example. Based on this key, it generates a
pseudorandom key stream (a sequence of bits
used as a key). which can be combined with the
plaintext digits by bit wise XOR operation. In a
stream cipher the plaintext digits are encrypted
one byte at a time.
Structure of Stream cipher
Properties of Stream Cipher

• The encryption sequence should have a large period. A


pseudorandom number generator uses a function that
produces a deterministic stream of bits that eventually
repeats. The longer the period of repeat the more difficult
it will be to do cryptanalysis.
• The key stream should approximate the properties of a
true random number stream as close as possible.
•The output of the pseudorandom number generator is
conditioned on the value of the input key. To guard
against brute-force attacks, the key needs to be
sufficiently long.
Stream Cipher Categories

 Synchronous stream cipher: the


keystream is constructed from the key,
independent of plaintext text.

 Non-Synchronous stream cipher: the


keystream is constructed from plaintext
text and/or ciphertext, as well as the key.
Application of Stream Cipher
Stream ciphers are often used in applications where
plaintext comes in quantities of unknowable length—for
example, a secure wireless connection.
For applications that require encryption/decryption of a
stream of data ,such as over a data communication
channel or a browser/web link ,a stream cipher might
be the better alternative.
Another application of stream ciphers is in military
cryptography.
RC4 Stream Cipher

In cryptography, RC4 is the most widely-used


software stream cipher and it is very popular.RC4 is
very simple and easy to explain.
It is designed in 1987 by Ron Rivest for RSA
Security. It is a variable key-size stream cipher . The
algorithm is based on the use of a random
permutation.
RC4 generates a pseudorandom stream of bits which,
for encryption, is combined with the plaintext using
XOR; decryption is performed the same way.
RC4 Implementation
 /* Initialization of S Vector */
for i = 0 to 255 do
S[i] = i;
T[i] = K[i mod keylen];
RC4 Implementation
 /* Initial Permutation of S */
j = 0;
for i = 0 to 255 do
j = (j + S[i] + T[i]) mod 256;
Swap (S[i], S[j]);
RC4 Implementation
 /* Key Stream Generation */
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];
RC4 Implementation
Application of Rc4

RC4 is used in many popular protocols such as SSL/TLS


(Secure Sockets Layer/Transport Layer Security)
standards that have been defined for communication
between web browsers and servers. It is also used in the
WEP (Wired Equivalent Privacy) protocol that is part
of the IEEE 802.11 wireless LAN standard. RC4 is used
in many other applications, including WPA(Wi-Fi
Protected Access), TKIP(Temporal Key Integrity
Protocol), Microsoft XBOX, Oracle SQL, Microsoft
PPTP, Microsoft Office, and Adobe Acrobat.
Experimental Results of RC4
We have got some test vector from the site
http://en.wikipedia.org/wiki/Rc4 .
These test vectors are not official, but convenient for
anyone testing their own RC4 program. The inputs are
ASCII, the output is in hexadecimal.

RC4( "Wiki", "pedia" ) == 1021BF0420.

RC4("Key","Plaintext")==BBF316E8D940AF0AD3.

RC4( "Secret", "Attack at dawn" )==


45A01F645FC35B38355254459BF5.
Graph for Encryption Time of RC4
Algorithm

8000
7000
Time (Microsecond) 6000
5000
4000 Encryption Time
3000
2000
1000
0
0 32 64 96 128 160
File Size (KB)
Graph for Decryption Time of RC4
Algorithm

8000
7000

Time (Microsecond)
6000
5000
4000 Decryption Time
3000
2000
1000
0
0 32 64 96 128 160
File Size (KB)
HOME TASK

1. Explain Stream Cipher crypto system.

You might also like