NETLEARN
Lesson 01Cryptography

Symmetric & Asymmetric Keys

Every lock in networking comes down to two ideas. A shared key is quick but has to reach both sides safely. A public and private key pair removes the sharing problem but is slow. The trick most of the internet uses is to combine them.

Layer
Layer 5/6 · the math under TLS
Reference
RFC 8017 / RFC 8439
Steps
4
Clientbrowser
Serversite + key pair
legendsecure / encryptedcautionresponsemessage in flight

Common misunderstandings

  • Do not encrypt bulk data with the asymmetric pair. It is far too slow; use it only to agree on a symmetric key.
  • A public key is not a secret, but it is also not proof of identity. It only becomes trustworthy when a certificate ties it to a name.

Key notes

Symmetric
One key, both sides. Fast, ideal for bulk data. Examples: AES, ChaCha20.
Asymmetric
A public and private pair. Slower, used for key exchange and signatures. Examples: RSA, ECDSA, X25519.
Signing
The pair also proves authorship: sign with the private key, and anyone can verify with the public key.
Forward secrecy
When the session key is derived from temporary keys, a later leak of the long-term private key cannot reopen a past session.