Tools / Public-key cryptography
RSA
RSA uses two related keys. Anyone can use the public key to encrypt a message, but only the private key can decrypt it. This demo runs locally and the keys disappear when you leave the page.
How RSA works
- Generate keys: make a public key and a private key.
- Encrypt: use the public key to lock a short message.
- Decrypt: use the private key to unlock it.
- Keep private: the private key must never be shared.
RSA encryption is different from password hashing: encryption is designed to be reversible with a key; a password hash is designed for verification without recovery.
Result
Encrypted message
Decrypted message