Cryptography & PKI

Symmetric vs. Asymmetric Encryption

Overview

Cryptography protects information using mathematical methods that make data unreadable or verifiable, supporting confidentiality, integrity, authentication, and non-repudiation. Symmetric and asymmetric encryption are the two fundamental approaches everything else builds on.

Key concepts

  • Symmetric: one shared key, fast, key-distribution problem
  • Asymmetric: public/private key pairs, RSA, Diffie-Hellman
  • Hybrid use in TLS/HTTPS

How it works

Symmetric encryption

Diagram of symmetric encryption using a shared key to encrypt and decrypt
Symmetric encryption: the same key locks and unlocks the data.

Uses the same secret key to encrypt and decrypt data. Both sender and receiver must securely possess that same key.

AdvantagesLimitations
Fast — works well for encrypting large amounts of dataSecurely sharing and protecting the secret key is the main challenge

Asymmetric encryption

Diagram of asymmetric encryption using a public key to encrypt and a private key to decrypt
Asymmetric encryption: different keys for encryption and decryption.

Uses two related keys — a public key and a private key. Data encrypted with one key can only be decrypted with the matching key.

TermMeaning
Public keyCan be shared openly — used to encrypt data or verify digital signatures.
Private keyMust be protected — used to decrypt data or create digital signatures.
Key pairA matched public key and private key created together.
RSAAn asymmetric algorithm commonly used for encryption, key exchange, and digital signatures.
Key exchangeThe secure process of establishing or sharing encryption keys between parties.
Diffie-HellmanA key-exchange method letting two parties establish a shared secret over an untrusted network.
AdvantagesLimitations
Simplifies secure key sharing — public keys can be distributed openlySlower than symmetric encryption; usually used for key exchange, identity verification, and signatures rather than bulk data

How they work together

Symmetric and asymmetric encryption are typically combined when establishing a connection. In HTTPS/TLS, for example, you establish a shared secret using asymmetric cryptography, then use that shared secret for fast symmetric encryption for the rest of the conversation.