🏗️ ΘρϵηΠατπ🚧 (under construction)

Public Key Cryptosystem
A public key cryptosystem is a crypotsystem such that there are two keys, a public key which anyone can know used for encoding, and a private key which only a decoder knows .

Each person has a pair of keys (e,d), and publishes that in a directory which everyone can see, and they keep their private key d on their system.

If A wants to send a message to B, they look up B's public key in the directory and then encrypt their plaintext message using it to produce the ciphertext.

In order to decipher the message, one has to decrypt it using B's private key which means that no-one else can read messages intended for B.

RSA Protocol

Suppose you want to allow someone to send you a message on your computer securely using the RSA protocol, then you do the following:

  1. Start with two large primes p,q. Compute n=pq and ϕ(n)=(p1)(q1).
  2. Choose some 1eϕ(n) relatively prime to ϕ(n) and compute an inverse d to e modulo ϕ(n) (i.e., de1(modϕ(n))).
  3. The public key is (e,n), the private key is d.
  4. From the point of view of a sender, to send a message, they take that message and break it into blocks which can be encoded as numbers 1mn. They send each block as a ciphertext given by c:=me % n
  5. To decipher a ciphertext c, compute mcd(modn).
Why Raising the Ciphertext to the Power of The Private Key Yields the Plaintext
Suppose that c is the ciphertext and d is the private key then the plaintext is given by cd % n