Seal a note so that only its reader can open it — and prove that it was you who sealed it. This small, story-first lab teaches public-key cryptography the way a paper envelope teaches privacy: by holding one in your hands.
| Paper envelope | In this lab |
|---|---|
| An envelope sealed shut | Encryption — a sealed box (X25519 + XSalsa20-Poly1305, via libsodium). Only the reader’s private key opens it; it is tamper-evident, too. |
| A signature across the flap | A digital signature (Ed25519). Sealing hides the contents; signing proves who sealed it. |
| Recognising a familiar hand | A fingerprint, pinned out-of-band — a public key is only trustworthy if you confirmed it through a separate, trusted channel. |
git clone https://github.com/petelittle/sealed-envelope-lab.git cd sealed-envelope-lab python -m pip install -r tools/requirements.txt python tools/sealed_envelope_lab.py genkeys --owner Alice --keys alice-keys.json python tools/sealed_envelope_lab.py genkeys --owner Bob --keys bob-keys.json python tools/sealed_envelope_lab.py pubs --keys bob-keys.json # share Bob's public keys python tools/sealed_envelope_lab.py seal \ --keys alice-keys.json \ --to "<Bob's encryption public key>" \ --file examples/hello-envelope.txt \ --out envelope.json
Bob then opens it with the open command, pinning
Alice’s signing public key — the full walkthrough lives in the
repository’s README and guides.
The lab is a teaching tool: it works on small files so that every part can be inspected and understood. It is not a production messaging product — the repository’s security notes say plainly where the simplifications are.