RSA and RC4
RSA and RC4
RSA and RC4
Cipher: RSA
Assumptions:
Algorithms for encryption/decryption are known to the public, Keys used
are kept secret.
One-Time Pad
• Developed by Gilbert Vernam in 1918, another name: Vernam Cipher
• The key
– a truly random sequence of 0’s and 1’s
– the same length as the message
– use one time only
• The encryption
• adding the key to the message modulo 2, bit by bit.
Encryption c i mi ki i 1,2,3,...
m i c i ki i 1,2,3,...
Decryption
mi : plain-text bits.
ki : key (key-stream ) bits
ci : cipher-text bits.
Example
• Encryption:
• 1001001 1000110 plaintext
• 1010110 0110001 key
• 0011111 1110110 ciphertext
• Decryption:
• 0011111 1110110 ciphertext
• 1010110 0110001 key
• 1001001 1000110 plaintext
One-Time pad practical Problem
• Solution :
– Stream Ciphers
– Key-stream is generated in pseudo-random fashion form Relatively
short secret key
Stream Cipher Structure
Figure illustrates the general structure of a stream cipher, where a key is
input to a pseudorandom bit generator that produces an apparently random
key stream of bits, and which are XOR’d with message to encrypt it, and
XOR’d again to decrypt it by the receiver.
RC4
RC4 is a stream cipher designed in 1987 by Ron Rivest for RSA Security. It
is a variable key-size stream cipher with byte-oriented operations.
Normally uses 64 bit and 128 bit key sizes.
Eight to sixteen machine operations are required per output byte, and the
cipher can be expected to run very quickly in software.
RC4 is probably the most widely used stream cipher. SSL/TLS (Secure
socket, transport layer security) between web browsers and servers, IEEE
802.11 wirelss LAN std: WEP (Wired Equivalent Privacy), WPA (WiFi
Protected Access) protocol
RC4 was kept as a trade secret by RSA Security, but in September 1994
was anonymously posted on the Internet
RC4 Key Schedule
RC4 Overview
Public-Key Cryptography
RSA Algorithm
The RSA scheme is a cipher in which the plaintext and ciphertext are
integers between 0 and n - 1 for some n. A typical size for n is 1024
bits. That is, n is less than 2^1024.
RSA Public Key Crypto System
Key generation:
1. Select 2 large prime numbers of about the same size, p and q
Typically each p, q has between 512 and 2048 bits
Encryption
Given a message M, 0 < M < n M Zn
use public key (e, n)
compute C = Me mod n C Zn
Decryption
Given a ciphertext C, use private key (d)
Compute Cd mod n = (Me mod n)d mod n = Med mod n = M
Cont.
C = Me mod (n = pq)
Plaintext: M Ciphertext: C
Cd mod n
M Cd mod n
M 7113 (mod 77) = 15
Thank You