Public Key Cryptography
Generate RSA and X25519 key pairs, build a hybrid encryption scheme the way real protocols do it (asymmetric crypto to exchange a key, symmetric crypto to encrypt the data), and understand why current guidance is moving new deployments toward elliptic curves.
Prerequisites: Completion of Symmetric Encryption Fundamentals; Python 3.10+ with cryptography installed.
Verified against the pyca/cryptography documentation, NIST SP 800-57 Part 1 Revision 5 (key-strength equivalence table), and NIST SP 800-131A Revision 2, July 2026. Key-size guidance here reflects NIST's current position: RSA-2048 provides roughly 112 bits of security and remains acceptable for now, but NIST's own schedule only treats 112-bit strength as sufficient through 2030 — new systems should target RSA-3072 (128-bit strength) or, preferably, an elliptic-curve alternative like X25519/Ed25519, which reach 128-bit security at a fraction of the key size. This project defaults to those stronger choices rather than the RSA-2048 examples still common in older tutorials.
Symmetric encryption has a bootstrapping problem: both parties need the same key before they can talk securely, but how do you get that key to them securely in the first place without already having a secure channel? Public key (asymmetric) cryptography breaks that circularity — each party has a mathematically linked key pair, one half published openly (the public key) and one half kept secret (the private key), where data encrypted with the public key can only be decrypted with the matching private key.
Two families dominate real-world use today: RSA, based on the difficulty of factoring large numbers, and elliptic curve cryptography (ECC), based on the difficulty of the discrete logarithm problem on an elliptic curve. Both remain secure against classical computers at appropriate key sizes; this project uses both so you can see the size and performance difference directly, not just read about it.
Generate an RSA key pair — and pick a size that will still be safe in a decade
Hybrid encryption: RSA wraps a key, AES does the actual work
Elliptic curve key exchange: smaller, faster, and how TLS actually does it
Serializing keys: getting them out of memory and onto disk or the wire
Secret Mission: build a two-party hybrid messaging exchange
Before You Go
Test what you just learned
Self-testing is one of the best ways to retain new skills. Unlock project quizzes to check your understanding.
Log in to unlock0 / 7 complete
