image.png

The 2 Big Use-Cases

Encryption that only the private key owner can read

→ Send a message and encrypt it with the public key. Now only the owner, for example a server, can decrypt it using the private key.

Signing that must have been done by the owner of the private key

→ I want to prove that I am indeed who I say I am, for example a server you search, I can sign a message with my private key, which can only be decrypted with my public key. This proves that I have the private key.

Why Asymmetric Encryption?

Symmetric Encryption doesn’t scale so well, since we have to create a key for every user.

image.png

Using asymmetric encryption we can create only one private key and give out one public key everybody knows.

image.png

Key to the concept of RSA is the FACTORING PROBLEM.

image.png

The one-way trapdoor in RSA is knowing the p and q, which together give you the n value. With that you can calculate totient(n) and then calculate the private key out of that.

p and q are both prime values.

image.png

All variables

Key Creation

→ Get a random p and q (must be big) and calculate an n. → Create a your private key using this formula and the public key most likely being 65537:

totient(n) = (p-1) * (q-1)

e * d ≡ 1 mod (totient(n)) → Which means that d is the multiplicative inverse of e and totient(n)