10.12.2012 Views

Prime Numbers

Prime Numbers

Prime Numbers

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

8.1 Cryptography 389<br />

is, if an oracle could tell you g ab on input of g a and g b , could you use this<br />

oracle to quickly solve for discrete logarithms?<br />

8.1.2 RSA cryptosystem<br />

Soon after the Diffie–Hellman ideas, the now prevalent RSA cryptosystem was<br />

invented by Rivest, Shamir, and Adleman [Rivest et al. 1978].<br />

Algorithm 8.1.2 (RSA private/public key generation). In this algorithm<br />

we generate an individual’s private and associated public keys for the RSA<br />

cryptosystem.<br />

1. [Choose primes]<br />

Choose two distinct primes p, q under prevailing safety criteria (see text);<br />

2. [Generate public key]<br />

N = pq;<br />

ϕ =(p − 1)(q − 1); // Euler totient of N.<br />

Choose random integer E ∈ [3,N − 2] coprime to ϕ;<br />

Report public key as (N,E); // User publishes this key.<br />

3. [Generate private key]<br />

D = E −1 mod ϕ;<br />

Report private key as D; // User keeps D secret.<br />

The primary observation is that because of the difficulty of factoring N = pq,<br />

the public integer N does not give an easy prescription for the private primes<br />

p, q. Furthermore, it is known that if one knows integers D, E in [1,n− 1]<br />

with DE ≡ 1(modϕ), then one can factor N in (probabilistic) polynomial<br />

time [Long 1981] (cf. Exercise 5.27). In the above algorithm it is fashionable<br />

to choose approximately equal private primes p, q, but some cryptographers<br />

suggest further safety tests. In fact, one can locate in the literature a host of<br />

potential drawbacks for certain p, q choices. There is a brief but illuminating<br />

listing of possible security flaws that depend on the magnitudes and other<br />

number-theoretical properties of p, q in [Williams 1998, p. 391]. The reference<br />

[Bressoud and Wagon 2000, p. 249] also lists RSA pitfalls. See also Exercise<br />

8.2 for a variety of RSA security issues.<br />

Having adopted the notion that the public key is the hard-to-break (i.e.,<br />

difficult to factor) composite integer N = pq, we can proceed with actual<br />

encryption of messages, as follows:<br />

Algorithm 8.1.3 (RSA encryption/decryption). We assume that Alice possesses<br />

a private key DA and public key (NA,EA) from Algorithm 8.1.2. Here we<br />

show how another individual (Bob) can encrypt a message x (thought of as an<br />

integer in [0,NA)) to Alice, and how Alice can decrypt said message.<br />

1. [Bob encrypts]<br />

y = x EA mod NA; // Bob is using Alice’s public key.<br />

Bob then sends y to Alice;<br />

2. [Alice decrypts]

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!