Public-Key Cryptography


Implement public-key cryptography step by step as below and its source code can be found from here. This interface does not need to be used. You may design your own interface as long as it will show the implementation of public-key cryptography step by step.
Note that this is only an example and it does not work or works incorrectly.


  1. Before testing, the instructor needs to clear the data stored in your system:  

  2. Enter two small prime numbers:   p:   and   q:      

  3. Pick another small number e, which is co-prime to (p-1)×(q-1).
    (Two numbers which do not have any other common factor other than 1 are called co-prime.)

    e:      

  4. Generate a public key:      

  5. Generate a private key:      

  6. Enter password:   &   interface:   in plain text.    

  7. Convert the password into ciphertext:

             

  8. Send the ciphertext to the (decryption) server (no plain text is sent except the interface value):