Algorithms · Overview

RSA: the public-key algorithm that changed cryptography

How RSA, the algorithm of Rivest, Shamir and Adleman, works: public and private keys, the mathematics of prime numbers, an example with small numbers, known attacks and use today.

For millennia, encrypting a message required sender and recipient to share the same secret key, delivered by some secure means. In 1977 three MIT researchers — Ron Rivest, Adi Shamir and Leonard Adleman — published a method that made the unthinkable possible: communicating secretly with someone using a key that anyone can know.

With RSA everyone has two keys. The public key is distributed freely and is used to encrypt messages meant for you or to verify your signatures. The private key stays yours alone and is used to decrypt those messages or to sign. Security rests on a mathematical fact: multiplying two large prime numbers is easy, recovering the two factors from the product is, with today’s computers, practically impossible.

1977the year RSA was presented to the public
2048bits: the minimum RSA key length considered adequate today
829bits: the largest RSA-type number publicly factored, in 2020

What it makes possible

Encryption
Anyone can encrypt a message with your public key; only you can decrypt it.
Digital signature
You sign with the private key; anyone verifies with the public key that the document comes from you and has not been altered.
Key exchange
In the past RSA was used to securely transmit the session key of a much faster symmetric algorithm.

RSA is one of the pillars of public-key cryptography, alongside Diffie-Hellman and elliptic curves; its mathematics rests on modular arithmetic.

↑