Key Generation Algorithm in rsa algorithm
by gowtham[ Edit ] 2010-02-05 15:14:54
1. Generate two large random primes, p and q, of approximately equal size such that their product n = pq is of the required bit length, e.g. 1024 bits. [See note 1].
2. Compute n = pq and (φ) phi = (p-1)(q-1).
3. Choose an integer e, 1 < e < phi, such that gcd(e, phi) = 1. [See note 2].
4. Compute the secret exponent d, 1 < d < phi, such that ed ≡ 1 (mod phi). [See note 3].
5. The public key is (n, e) and the private key is (n, d). Keep all the values d, p, q and phi secret.
* n is known as the modulus.
* e is known as the public exponent or encryption exponent or just the exponent.
* d is known as the secret exponent or decryption exponent