Introduction to Encryption

RSA Algorithm and Poker


Introduction

We will spend more time on computer security issues next term if students and TAs pursue research projects in the area. This term, we only have time for a very brief introduction.

There are many aspects to computer security including:

Our purpose in this term is to discuss confidentiality, and give you a brief description of the interesting problem of developing attacks, and proving that a protocol is immune to attacks.

The simplest encryption problem is this. A sender applies an encryption function f to a message M, and sends the encrypted message f.m to a receiver. The receiver applies a decrypting function g to get g.f.m. We require that g.f = I where I is the identity function. Furthermore, computing the decrypting function g, given the intercepted messagesf.m (or f.m and f.m' and f.m'' for a sequence of messages m, m', m'' ) should be very difficult if not impossible. Likewise, computing the plaintext messages m, m', m'' (even if the attacker does not have the decrypting function g) must also be difficult if not impossible.

In a public-key protocol, the interceptor has access to f. So, the interceptor has both f, and f.m, f.m', f.m'', ... Nevertheless, the interceptor should be unable to compute g or m, m', m'' ... Public key protocols can be more difficult because the interceptor has access to the encryption function. On the other hand, if a process X publishes its encryption f, but keeps the corresponding decryption function g secret, then other processes can communicate with X securely merely by applying f to all the messages that they send X. Thus, public key encryption simplifies the overall communication protocol.

In a symmetric protocol the interceptor does not have access to f. In symmetric protocols, g can be computed from f; usually there is a common key used for both encryption and decryption. (Public-key protocols are sometimes called asymmetric protocols.) Symmetric protocols have the advantage of relative simplicity, but the disadvantage that the communicators must agree on a shared secret, namely the function f.

An assumption made in cryptanalysis is that the attacker knows the protocol, but does not know the decryption function. In practise, the attacker may not know which of several possible protocols are being used by the communicators; nevertheless, the usual assumption is that they do know the protocol.

The RSA Algorithm

The RSA is a public-key algorithm named after its inventors: Rivest, Shamir and Adleman. The algorithm is as follows.

Outline: Proof of Correctness

We first prove that g.f is the identity function. To carry out this proof, we show that for any positive integer M, where M is less than e, (M**e)**d mod n = M. The proof uses Fermat's little theorem.

Fermat's little theorem says that for any M which is not a multiple of p, and any prime p: M**(p-1) mod p = 1.

For instance, 
4**(7-1) mod 7 = 4096 mod 7 = 4096 - 7*585 = 1
3**(7-1) mod 7 = 729 mod 7 = 729 - 7*104 = 1

Let p and q be primes.

From Fermat's little theorem, 
(M**(p-1))**(q-1)mod p = (M**(p-1)mod p)**(q-1) = 1**(q-1) = 1.
Therefore M**s - 1 is divisible by p. (Recall that s = (p-1)*(q-1).)
By symmetry, M**s - 1 is divisible by q.
Hence, M**s - 1 is divisible by p*q which is n.
Hence, M**s mod n = 1.

Recall that e, d are chosen so that there exists an integer c such that:
e*d = 1 + c*s.
Hence, M**(e*d) mod n =
(M**1) * (M**s)**C mod n =
M * (M**s mod n)**C mod n =
M * (1 ** C) mod n = M.

Attacks

An attacker has e and n. The attacker attempts to compute d. So, the attacker can attempt to find a d such that e*d mod s = 1. But, the attacker does not have s. How can the attacker compute s from n. One approach is to factor n into p and q. The problem is that there is no generally known algorithm to factor large numbers rapidly. (Perhaps the National Security Agency knows of a way, but they aren't telling.)

From CS 141.