Thursday, August 20, 2009

13rd Aug 2009 - Lab 4: Modern Cryptography

Today in the lab session, Mr. Zaki going to teaches us how to find the private and public key using the RSA algorithm. What is public and private key? Public key and private key is the unique pair of key that widely use in asymmetric encryption.

Usually the private key is kept secret while the public key may be widely distributed. Messages are encrypted with the recipient's public key and can only be decrypted with the corresponding private key. The keys are related mathematically. However, even you know the public key; you also cannot derive the private key from the public key. So it can prove the authenticity.

How using RSA algorithm to calculate private key and public key? Below is the steps to calculate private and public key:

  1. Select primes: p=17 & q=11
  2. Compute n = pq = 17*11=187
  3. Compute node n = (p-1)(q-1) = 16*10 = 160
  4. Select e: gcd(e,160)=1
  5. Determine d: d*e = 1 mod 160. So value d=23
After the 5 steps, publish key PU={e,n}; PU = {7, 187} and secret private key is PR={d,n}; PR = {23, 187}.

No comments:

Post a Comment