RSA Public Key Encryption


Background

Public key encryption system has three parts:

  1. Key Generation: The recipient of a secret message generates a public key which is shared, and a private key which is kept secret. The keys are generated in a way that conceals their construction, and makes it difficult to find the private key by only knowing the public key.
  2. Encryption: A secret message to any person can be encrypted with their public key.
  3. Decryption: Only the person being addressed can easily decrypt the secret message using the private key.

Objectives

Steps

  1. Generate public and private keys.
  2. RSA Encryption
  3. RSA Decryption

Bonus

  1. Greatest Common Divisor (GCD)
  2. Cofactors (Extended GCD)
  3. Power Modulo

Congratulations! You have successfully investigated and witnessed how RSA public key cryptosystem works.