Skip to content
CryptoAcademy logo CryptoAcademy
Menu
Intermediate Cryptography

Public key cryptography

Cryptography with a matched key pair: a public key anyone may use, and a private key only you hold.

Public key cryptography at a glance
Symmetric encryption uses one shared key; asymmetric uses a public and a private key Symmetric — AES-GCM Same key encrypts and decrypts Plaintext pay 1 BTC Ciphertext a9f3…1c Shared key K secret, 256-bit Fast · problem: how to share the key safely? Asymmetric — RSA / ECDSA A public key and its private key are a pair Public key shared with everyone Private key never leaves the owner mathematically linked (trapdoor) Anyone encrypts → only owner decrypts Slower · solves key distribution and signatures How the web combines both (TLS) 1. Your browser fetches the site's public key inside a certificate. 2. Both sides derive a temporary symmetric session key (key exchange). 3. Everything after that is encrypted fast with AES-GCM — signatures only prove who you are.

In simple terms

Anyone can encrypt to your public key or verify your signature; only the private key can decrypt or sign. The keys are mathematically linked but cannot be derived backwards.

Analogy

A mailbox slot: anyone can drop a letter in, only you with the key can take mail out.

Going deeper

Security rests on trapdoor problems: integer factorisation and discrete logarithms (RSA, DSA) or elliptic-curve discrete logarithms (ECDSA, Ed25519, X25519). A 256-bit elliptic-curve key matches ~128-bit security, so keys stay small enough for phones and certificates.

Common mistake

Public keys are meant to be public — but private keys must never leave secure storage, and "encrypt with the private key" is a myth: signing is a different operation.

Share this page

Send this link to a friend, or scan the QR code to open it on your phone.