eli5 can someone explain to me what the RSA algorithm in cybersecurity is please

139 views

eli5 can someone explain to me what the RSA algorithm in cybersecurity is please

In: 7

4 Answers

Anonymous 0 Comments

It is an encryption algorithm. It takes a message, plus a key, performs some mathematical operations on it, and you get an encrypted message.

It’s notable in that it is a form of *asymmetric* encryption meaning you must use a different key to decrypt it; the key used to encrypt it won’t work.

It relies on a number of different mathematical principles to achieve this effect while remaining secure, but each of those would constitute their own ELI5 posts. But an overview of the process is this:

1. You choose two large prime numbers: p and q.
2. You calculate n = p * q
3. You calculate lambda(n) which is equal to the least common multiple of p-1 and q-1.
4. You choose an integer, e, such that e is greater than 1, less than lambda(n) and shares no factors with lambda(n).
5. You choose an integer, d, such that d * e, when divided by lambda(n), gives you a remainder of 1.

The public key (the key typically used for encryption) consists of n and e. To encrypt a message, M, you would convert it into a number, raise it to the power of e, then find the remainder if it was divided by n^(*). This gives you the cipher text C.

The private key (the key typically used for decryption) consists of n and d. To decrypt you would take your cipher text C, raise it to the power of d, then find the remainder if it was divided by n^(*). This gives you back your original message, M.

The magic works based on how d and e are related with respect to lambda(n), but, again, is it’s own ELI5 post. But the strength of the algorithm rests on an attacker not being able to figure out d. But since lambda(n) is based on n (or, rather, its factors of p and q) and since an attacker knows e and n, if the attacker was able to figure out p and q, it could figure out lambda(n) and therefore d. This is why we use large primes as p and q: it makes n extremely difficult to factor. It would take modern computers many many years to factor the n’s of the sizes we use today.

^(*) ^(this is a simplification. Computers don’t actually take the message or cipher text, raise it to e or d, then divide by n and look at the remainder. The numbers involved are simply too large. Rather there are a number of mathematical shortcuts and simplifications computers use to get to that answer.)

You are viewing 1 out of 4 answers, click here to view all answers.