What is Public Key Cryptography?
A cryptographic system that uses pairs of keys: public keys (which may be disseminated widely) and private keys (which are known only to the owner). This enables secure communication between parties who have never met and forms the basis for digital signatures, key exchange, and encrypted communication.
Also known as: Asymmetric Cryptography, PKI, Public Key Infrastructure
Public key cryptography solved one of the oldest problems in cryptography: how do two people communicate securely if they've never met to exchange a secret key?
The Key Pair
Every user has two mathematically linked keys:
Public Key
- Can be shared with anyone
- Used to encrypt messages TO you
- Used to verify signatures FROM you
- Like your email address—public knowledge
Private Key
- Must remain secret at all times
- Used to decrypt messages sent to you
- Used to create digital signatures
- Like your email password—never shared
Core Operations
Encryption
- Alice wants to send Bob a secret message
- Alice encrypts with Bob's PUBLIC key
- Only Bob's PRIVATE key can decrypt it
- Even Alice can't decrypt what she just sent!
Digital Signatures
- Bob wants to prove he wrote a message
- Bob signs with his PRIVATE key
- Anyone can verify with Bob's PUBLIC key
- Proves authenticity and integrity
Real-World Applications
- HTTPS/TLS: Secures all web traffic
- Email encryption: PGP/GPG
- Cryptocurrency: Wallet addresses are public keys
- SSH: Secure server access
- Code signing: Verify software authenticity
The Math Behind It
Public key crypto relies on "trapdoor functions"—easy to compute one way, nearly impossible to reverse:
- RSA: Factoring large prime numbers
- ECC: Elliptic curve discrete logarithm
- Diffie-Hellman: Discrete logarithm problem
Key Management
Your private key is everything:
- If compromised, all security is lost
- If lost, encrypted data is gone forever
- Use strong passwords on private keys
- Store backups securely (encrypted, offline)
Related Terms
Encryption
The process of converting information into a code to prevent unauthorized access. Encryption transforms readable data (plaintext) into an unreadable format (ciphertext) using a cryptographic algorithm and key. Only those with the correct key can decrypt and read the original data.
End-to-End Encryption
A method of secure communication where only the communicating users can read the messages. In principle, it prevents potential eavesdroppers – including telecom providers, Internet providers, and even the provider of the communication service – from being able to access the cryptographic keys needed to decrypt the conversation.
PGP
Pretty Good Privacy (PGP) is an encryption program that provides cryptographic privacy and authentication for data communication. It's used for signing, encrypting, and decrypting texts, emails, files, and directories, and is the gold standard for email encryption.
Have more questions?
Use our guided flow to get the right next privacy step for Public Key Cryptography.
Open Guided Flow