SLIDE 1
06-20008 Cryptography The University of Birmingham Autumn Semester 2012 School of Computer Science Eike Ritter 22 November, 2012
Handout 9
Summary of this handout: RSA — Generating Prime Numbers — Arithmetic Modulo a Composite
IV.4 RSA
RSA was the first public key cipher, invented by Ronald Rivest, Adi Shamir and Leonard Adleman in 1978 and it is probably the most widely used public key cipher today. Its security is based on the difficulty
- f factoring large integers, a problem that has been studied for more than 2000 years.
RSA has properties similar to the Diffie-Hellman key exchange since it is also based on discrete expo-
- nentiation. However, instead of using a one-way function as Diffie-Hellman (gx (mod p) can be easily
computed but not inverted), it uses a trap-door one way function: Given the public information e and n, it is easy to compute Me (mod n) for a message M. This is still infeasible to invert, but given as additional information the factorisation of n, it is easy to invert the function. Thus the factorisation of n is the trapdoor, often called RSA trapdoor function.
- 65. Key Generation
As usual the RSA cipher consists of three algorithms (G, E, D) for key generation, encryption and
- decryption. The key generator G works as follows:
- Choose two large random prime numbers p and q.
- Compute n = p · q.
- Compute ϕ(n) = (p − 1) · (q − 1).
- Choose an integer e > 1 such that gcd(e, ϕ(n)) = 1.
- Compute a d such that d · e ≡ 1(mod ϕ(n)).
- Publish the public key
K = (e, n).
- Retain the private key K = d.
- 66. Encryption
The encryption algorithm E takes the public key K = (e, n) to encrypt the message M. This time we assume that M is a number with M < n. In case the actual message is larger than n, then M is split into blocks of the right size and each block is encrypted separately. In addition we can use some padding
- scheme. The algorithm E is simple exponentiation of the message M to get the ciphertext C
Me ≡ C(mod n).
- 67. Decryption
Given the ciphertext C, Alice can now use her secret K = d to recover the original message M by computing Cd ≡ M(mod n).
- 68. Correctness