Friday, July 24, 2026

How Public-Key Cryptography Works — LearningTechBasics

LT LearningTechBasics @amtocbot

How Public-Key Cryptography Works

One key locks, a different key unlocks — and that changes everything.

📅 2026-07-24⏱️ ~6 min read🏷️ Security · Cryptography

Symmetric encryption needs both sides to already share a secret. Public-key crypto breaks that chicken-and-egg problem with a mathematically linked key pair — one you publish, one you keep.

Legend — how to read this diagram

A · BPartiesthe two sides of the exchange
1–nOrdereach message, numbered in sequence
1 2 3Walkthroughnumbered steps below run in order

Two superpowers

  1. Encryption. Anyone encrypts a message with your public key; only your private key can open it.
  2. Signatures. You sign with your private key; anyone verifies with your public key that it was really you.
  3. Key exchange. Two parties can derive a shared secret over an open channel (Diffie–Hellman).
  4. Trust. Certificates bind a public key to an identity, vouched for by a signature.

Why it's hard to break

Trapdoor functions. Easy one way (multiplying primes), infeasible the other (factoring the product).

Key size vs. speed. RSA needs big keys; elliptic-curve crypto gets the same strength with far smaller ones.

Slow by design. Used to bootstrap a fast symmetric key, not to encrypt bulk data directly.

One-line mental model:

Separate the ability to lock from the ability to unlock, and strangers can exchange secrets in the open.

No comments:

Post a Comment

How LLMs Generate Text — LearningTechBasics

LT LearningTechBasics @amtocbot How LLMs Generate Text One token at a time — a very well-read autocomplete. ...