Asymmetric encryption: how public and private keys work

Asymmetric encryption: how public and private keys work

Natalie Moore
April 6, 2026· Updated August 9, 2026· 6 min read

Asymmetric encryption, also called public-key cryptography, uses a pair of mathematically related keys to protect data: one key you can publish as a public key, and another key that stays private as the private key. It is a core building block of modern internet security and keeps your online activity private while browsing and messaging.

Use the online security guide as the baseline: it connects this risk to account, device, browser, and network hardening.

Key Takeaways

  • Different keys for lock and unlock: the public key locks data, the private key unlocks it.
  • Keep your private key private: it is never sent over the network, which cuts the risk of interception.
  • Verify identity: besides encryption, private keys also sign data so recipients can confirm it was really sent by you.
  • Usually paired with symmetric encryption: because asymmetric math is slow, it is often used for setup, then data moves through faster symmetric encryption.

What Is Asymmetric Encryption?

Set aside formulas for now. In symmetric encryption, both parties share a single key. If that key leaks, all messages are exposed.[1]

Asymmetric encryption solves this with two keys.

Public mailbox analogy

Think of a public mailbox you put on the street:

  • Public key (mail slot): like the slot, you can share this openly. Anyone who wants to send you information puts it in through the slot.
  • Private key (locker key): once the message is in, the slot cannot be opened. Only the key owner can open it and read the content.[2]

How does it work?

Now let’s map this to software systems.

1. Generating a key pair

A security app creates a pair locally. Although both keys look random to humans, they are mathematically linked. You can compute a public key from a private key, but in practice it is infeasible to reverse that process using current computing power.

2. Encryption and decryption process

When a sender wants to send confidential data:

  1. The sender gets the recipient’s public key.
  2. The message is encrypted into unreadable ciphertext.
  3. The recipient uses their private key to decrypt.
  4. The message returns to readable text.

Even if a hacker intercepts traffic, it remains ciphertext without the private key.

3. Digital signatures: proving authorship

Asymmetric encryption also enables digital signatures. If you also want proof that a message is authentic:

  1. Create a hash fingerprint of your file.
  2. Sign the hash with your private key.
  3. Verify the signature with your public key.

If verification succeeds, the file is confirmed to come from the private-key holder and was not changed.


Common Asymmetric Encryption Algorithms

Over the decades, cryptographers created several algorithms.

RSA (Rivest-Shamir-Adleman)

RSA is one of the most established options. Its security relies on the difficulty of factoring very large integers. Multiplying two large primes is easy; reversing that multiplication is currently impractical. RSA commonly uses 2048-bit or 4096-bit keys, trading speed for strength.

Elliptic Curve Cryptography (ECC)

ECC uses the hard problem of elliptic curve discrete logarithms and reaches similar security as longer RSA keys with much shorter key lengths. It is faster and lighter, which suits mobile devices.

Diffie-Hellman key exchange (DH)

Strictly speaking, DH does not directly encrypt message content. Its strength is helping two parties establish a shared secret over potentially hostile networks. Many modern wire protocols like ECDH use this model as a foundation.

Asymmetric vs Symmetric Encryption

DimensionSymmetric EncryptionAsymmetric Encryption
Number of keysOne key for both encryption and decryptionTwo keys: public to encrypt, private to decrypt (or vice versa)
Typical analogyA padlock with one codeA public mailbox where everyone can drop messages but only the owner opens
SpeedVery fast, best for large data streamsSlower and more CPU-intensive
Key exchangeHarder: key distribution must be secureEasier: public key can be openly shared
Common useLocal storage encryption, high-volume VPN dataHTTPS certificate auth, session handshakes

Real-world use cases

Though it sounds academic, you use it every day.

HTTPS and secure browsing

During a modern TLS handshake, asymmetric cryptography authenticates the server and helps establish shared session keys. After the handshake, application data is protected with faster symmetric encryption.[3]

Email and end-to-end messaging

Whistleblowers and journalists often rely on PGP principles. They publish their public key and receive encrypted tips, while the private key on their local device performs decryption. Instant-messaging apps like WhatsApp and Signal also use this model for end-to-end encryption.

Cryptocurrency

In Bitcoin and Ethereum ecosystems, wallet addresses are derived from public keys, while private keys are needed to spend funds. Lose your private key, and you effectively lose control of your assets forever.

Summary and trade-offs

Asymmetric encryption answers an old security question: how to send secrets securely without pre-sharing a private key. It enables strong identity verification but is not ideal for bulk data.

Its disadvantages are computational cost and more complex certificate trust management.

For this reason, modern systems almost always combine asymmetric safety with symmetric performance.

Frequently Asked Questions (FAQ)

Why is asymmetric encryption slower?

Algorithms like RSA involve heavy mathematical operations such as big integer modular arithmetic, which is expensive for large volumes. It is therefore used mainly for temporary key exchange, not bulk media transfers.

What happens if my private key is exposed?

That is a critical breach. Anyone with your private key can decrypt traffic sent to you and forge signatures in your name. You should immediately revoke and replace the key pair through the relevant certificate authority.

How is encryption different from digital signature?

For confidentiality, you encrypt with the recipient’s public key so only they can open it. For identity proof, you sign with your private key so anyone can verify authenticity with your public key.

Is SSH using asymmetric encryption?

Yes. SSH authentication and key exchange heavily rely on asymmetric cryptography instead of weak password-only access.

How does a VPN use asymmetric encryption?

Modern VPN protocols such as WireGuard or OpenVPN also use a hybrid design. A secure connection is first established through asymmetric exchange, then traffic is encrypted with a symmetric key for speed.


Disclaimer This article is for informational purposes only and does not constitute legal, technical, or other professional advice. As computing power evolves (including quantum computing), encryption standards may change over time.

AethoVPN does not replace the non-network steps in “Asymmetric encryption: how public and private keys work”.

Sources:

  1. IBM: What is cryptography?
  2. Cloudflare: What is public key cryptography?
  3. IETF: RFC 8446 — The Transport Layer Security (TLS) Protocol Version 1.3

Sources checked 9 August 2026.


Related Articles:

Start your 3-day free trial

Sign up to experience all premium features at no cost.

*Available only to new users. Each user is limited to one trial.

Asymmetric encryption: how public and private keys work | AethoVPN