You are on page 1of 4

Public Key Cryptography Prior to the 1980s, if two people were to exchange a secret message over the Internet,

the sender had to encrypt it. In order to encrypt the secret message, the sender had to use a key, which was itself a secret. Therefore there was the problem of transmitting the secret key to the receiver in order to transmit the secret message. (during transmission someone else might intercept and obtain the secret key) Diffie, Hellman and Merkle contributed to a solution of the key-distribution problem. They concocted a new type of cipher incorporating asymmetric key, in which the encryption key and decryption key were not identical. A person (the receiver of message) will have his own pair of keys: an encryption (public) key and decryption (private) key. He publishes his encryption key so that others (the sender of a message or public) can encrypt a message using it. He will then decrypt the message received using the decryption key he created. The system involves the sender of the message (the public), S and the receiver of the message R .The message receiver is able to change his secret code any time without having to inform the sender of the change. Rivest-Shamir-Adleman (RSA) system was one of the earliest public key cryptosystem where it was applied in encoding an decoding a message. The RSA depends on the fact that it is easy to generate two large p and q primes and multiply them together (n=pq), but it is much more difficult to factorize the product of the two primes. The RSA system of public-key cryptography can be described as consisting the following steps: 1. Bob (The sender ) chooses secret primes p and q and computes n = p x q. 2. Bob computes (n) = (p 1)(q 1). (Fermats formulae) (n) = (p 1)(q 1). (n). (n) and D secret.

3. Bob chooses E relatively prime to

4. Bob computes D such that D.E = 1 mod

5. Bob makes n and E public, but keeps p, q,

6. Alice encrypts a message P as C = PE mod n and sends it to Bob. 7. Bob decrypts the message sent by Alice using his private key.
1

7. Bob decrypts Alices message by computing P = CD mod n.

Example: Suppose Bob chooses p = 7, q = 11, and E = 13. (i) Write down the values of n and (n).

(ii)

Find D such that D.E = 1 mod (n).

(iii) If Bob receives the message 27 from Alice, what message did Alice send?

(i) n = 7 11 = 77 (n) = (7 1)(11 1) = 6 10 = 60 (ii) By using the Euclidean Algorithm, (n) = 60, E= 13 GSF(60, 13) 60 = 4 13 + 8 13 = 1 8 + 5 8=1 5+3 5=1 3+2 3=1 2+1 2=2 1+0 By working backwards, 1=31 2 = 3 1 (5 1 3) =2 31 5 =2 8 1 5) 1 5 =2 83 5 = 2 8 3 (13 1 8) = 5 8 3 13 =5 60 4 13) 3 13 = 5 60 23 13 23 13 = 1 + (5) 60 23 13 = 1 mod 60 23 = 37 + (1) mod 60
2

= 37 mod 60 So, D = 37 since D.E = 1 mod (n). 23 13 = 1 mod 60 37.13 = 1 mod 60

(iii)

P = CD mod n = 2737 mod 77 272 mod 77 = 729 mod 77 = 36 273 mod 77 = 19683 mod 77 = 48 274 mod 77 = 362 mod 77 = 1296 mod 77 = 64 278 mod 77 = 642 mod 77 = 4096 mod 77 = 15 2716 mod 77 = 152 mod 77 = 225 mod 77 = 71 2732 mod 77 = 712 mod 77 = 5041 mod 77 = 36 2737 mod 77 = 2732 273 272 mod 77 = 36 48 36 mod 77 = 62208 mod 77 = 69 So the original message P is 69.

Try another example,

(i) . (ii) (i)

suppose Bob choose p = 3 and q = 7, determine the value of n and If E =5 and DE = 1 mod , find the value of D the inverse of E.

Given the coded message C= 243, find the original message P.

(b)(i) n = pq = 3 x 7=21 = (p-1)(q-1) = (3 1)(7 1)


3

= 12 (ii) Given DE = 1 (mod DE = Use Eucledian geometry to find D. (check: 5 D = 12 k + 1 When k = 2 5 D = 25 D = 5) (iii) C = 243 P = CD (mod n) = 2435 (mod 21) 243 (mod 21) = 12 (mod 21) 2432 (mod 21)= 2431. 2431(mod 21) = 12 x 12 (mod 21) = 144 (mod 21) = 18 (mod 21) 2432 (mod 21)= 2431. 2431(mod 21) = 12 x 12 (mod 21) = 144 (mod 21) 2435 (mod 21)= 2431. 2434(mod 21) = 12 x 9 (mod 21) = 108 (mod 21) = 3(mod 21) = 3 )

You might also like