Step 1 Make a pair
You are Sam. Generate your public key and matching private key.
Step 2 Encrypt a note to you
Maya has only your public key. Write her note, then encrypt it.
This RSA-OAEP setup has a 190-byte message limit.
Why the counter can run ahead of what you typed
The limit counts UTF-8 bytes, not characters. ASCII letters use one byte; accented letters and emoji can use several.
Hybrid encryption establishes a shared key and uses it to encrypt longer messages. Explore that in HPKE Envelope.
Step 3 Open it — and see what opening proves
Try your key, a different key, and a note from a stranger.
Open it with your private key
Now try the wrong key
Predict first — optional
Can an unrelated private key open the same encrypted note?
Can a stranger send you a note?
Predict first — optional
A stranger encrypts their own note using only your public key. Try opening it.
Step 4 The same pair, a different job
Decryption does not identify the sender. Sign with your private key; Maya checks with your public key. She must also know that key is yours.
Predict first — optional
Check it with the public key
Check the signature, then edit the note and check again.
Editing changes the note, not its signature.
Quick check — which key did which job?
What each job does, and does not, establish
| Job | Key used | What it does NOT establish |
|---|---|---|
| Encrypt | The recipient’s public key | Who sent the note |
| Decrypt | The recipient’s private key | Who sent the note |
| Sign | The signer’s private key | Secrecy, or whether the note is true |
| Verify | The signer’s public key | Whose key it is, unless you already know |
Three questions
Check your understanding. No score or saved answers.
How this demo checks its own results
On load, your browser checks published test cases, including ones it must reject.