RSA-OAEP · SHA-256 · AES-256-GCM
RSA and hybrid
Generate a key pair: share the public key, keep the private key. Data encrypted with the public key can only be decrypted by the holder of the private key.
How it works
- RSA is a key pair: data encrypted with the public key can only be decrypted with the private key. Its security rests on how hard it is to factor the product of two large primes.
- RSA can only encrypt a few hundred bytes at a time and is slow. So every message gets a random AES-256 key, the data is encrypted with AES-GCM, and RSA-OAEP encrypts ("wraps") only that AES key. This is called hybrid encryption; HTTPS and PGP work the same way.
- OAEP is the padding scheme that adds randomness to RSA: the same key encrypting the same message twice gives different output, and the old "textbook RSA" attacks no longer work.
- The fingerprint is the SHA-256 hash of the public key. When you receive someone's public key, confirm the fingerprint with them another way (phone, in person) so you would notice if someone in between handed you their own key.
The private key is downloaded as an unencrypted PEM. In real use, keep it somewhere safe (e.g. a password manager).