What it is and the problem it solves
Public-key cryptography is an asymmetric cryptosystem that solves two problems: secure key agreement without prior shared secrets, and verifiable digital signatures. It replaces the logistical bottleneck of symmetric key distribution with mathematical asymmetry.
How it works
It uses one-way mathematical functions: exponentiation modulo a product of two large primes (RSA) or discrete logarithms (Diffie–Hellman). Public keys are openly shared; private keys remain secret. Encryption, decryption, and digital signatures all rely on the asymmetry — easy to compute in one direction, computationally hard to reverse without the private key.
What works
Diffie–Hellman key exchange establishes shared secrets over untrusted channels. RSA encrypts, decrypts, and signs using modular exponentiation. Both allow public keys to be published freely while preserving security — provided private keys stay secret and implementations avoid known pitfalls.
What does not
It does not guarantee confidentiality on its own. It requires authenticated channels for Diffie–Hellman and proper padding for RSA to resist known attacks. It offers no protection against compromised private keys, side-channel leakage, or quantum computation.
What it changes
It eliminates the need for pre-shared secrets in open networks. It enables verifiable authorship at global scale. It shifts trust from physical key distribution to computational assumptions and key management discipline.
Is it worth your time
Yes. It is the operational foundation of TLS, SSH, PGP, and every modern digital signature scheme. If you handle authentication, encryption, or integrity verification in software or infrastructure, you depend on its mechanisms — not just its abstractions.
