RSA
RSA is a public-key encryption algorithm that enables secure data transmission over insecure channels. With an insecure channel, we expect adversaries to eavesdrop on it.
Calculator: https://www.cs.drexel.edu/~popyack/IntroCS/HW/RSAWorksheet.html
RSA is based on the mathematically difficult problem of factoring a large number. Multiplying two large prime numbers is a straightforward operation; however, finding the factors of a huge number takes much more computing power.
Prime number 1:
Prime number 2:
Their product:
On the other hand, itβs pretty tricky to determine what two prime numbers multiply together to make and even more challenging to find the factors of .
In real-world examples, the prime numbers would be much bigger than the ones in this example. A computer can easily factorise ; however, it cannot factorise a number with more than 600 digits. And you would agree that the multiplication of the two huge prime numbers, each around 300 digits, would be easier than the factorisation of their product.
Bob chooses two prime numbers: and . He calculates .
With , Bob selects such that is relatively prime to ; moreover, he selects , where mod , i.e., and mod . The public key is , i.e., and the private key is $(n,d), i.e., .
Letβs say that the value they want to encrypt is , then Alice would calculate and send mod mod .
Bob will decrypt the received value by calculating mod mod . This way, Bob recovers the value that Alice sent.
p and q are large prime numbers
n is the product of p and q
The public key is n and e
The private key is n and d
m is used to represent the original message, i.e., plaintext
c represents the encrypted text, i.e., ciphertext
IRL this would be done with much bigger numbers
Last updated