Lesson 3 of 5 Cryptography Fundamentals

Symmetric, Asymmetric and Elliptic Curve Cryptography

Symmetric and asymmetric cryptography solve different problems and are combined in nearly every secure system. This lesson explains how each works, their algorithms, strengths and weaknesses, elliptic curve cryptography and hybrid cryptosystems.

Learning outcomes

After completing this lesson, you will be able to:

  • Explain symmetric encryption, block and stream ciphers and modes of operation.
  • Explain asymmetric encryption and key agreement.
  • Calculate the number of keys needed for symmetric and asymmetric schemes.
  • Describe ECC and hybrid cryptography.

Symmetric encryption

In symmetric (secret-key) encryption, the same key encrypts and decrypts. Symmetric algorithms are fast and efficient, so they are used for bulk data: disk and database encryption, file encryption and the data channel of TLS, IPsec and VPNs.

Block ciphers encrypt fixed-size blocks. The Advanced Encryption Standard (AES), standardised by NIST in 2001 from the Rijndael algorithm, uses 128-bit blocks and keys of 128, 192 or 256 bits and is the standard worldwide. Older algorithms are DES (56-bit key, broken by brute force) and 3DES (retired by NIST after 2023). Stream ciphers encrypt data a bit or byte at a time; ChaCha20 is a modern stream cipher used in TLS, especially on devices without AES hardware support. RC4 is broken.

Block ciphers are used in modes of operation. ECB encrypts each block independently, so identical plaintext blocks give identical ciphertext and patterns show; it must not be used. CBC chains blocks with an initialisation vector. GCM (Galois/Counter Mode) is an authenticated encryption mode that provides both confidentiality and integrity and is preferred today.

Symmetric cryptography's weakness is key distribution: both parties need the same secret key, delivered securely, and every pair of parties needs its own key. For n parties, that is n(n-1)/2 keys: 10 people need 45 keys, 1,000 people need 499,500.

Sort into groups

Symmetric or asymmetric?

Exam skills 5.2.3

Decide which kind of encryption each statement describes.

Log in to try this activity Interactive activities are free with an account.

Asymmetric encryption

In asymmetric (public-key) cryptography, each party has a mathematically related key pair: a public key that can be shared with anyone and a private key that is kept secret. Data encrypted with the public key can be decrypted only with the private key, so anyone can send a confidential message to the key owner. Conversely, a signature made with the private key can be verified by anyone with the public key, which proves the signer's identity. Each party needs only one key pair, so n parties need 2n keys in total.

Asymmetric algorithms rely on mathematical problems that are easy in one direction and hard in the other. RSA relies on the difficulty of factoring the product of two large primes and is used for encryption and signatures. Diffie-Hellman lets two parties agree on a shared secret over an insecure channel without ever sending it; ephemeral Diffie-Hellman (DHE or ECDHE) gives forward secrecy, meaning that compromise of a long-term key later does not expose past sessions. DSA and ECDSA are signature algorithms. Asymmetric operations are much slower than symmetric ones, so they are used for small amounts of data: keys and signatures.

Scenario questions

Which key?

Exam skills 5.2.3

Choose the right key for each operation.

Log in to try this activity Interactive activities are free with an account.

Elliptic curve cryptography

Elliptic curve cryptography (ECC) is asymmetric cryptography based on the mathematics of elliptic curves over finite fields. Its advantage is efficiency: it achieves the same security as RSA with much shorter keys. A 256-bit ECC key provides security comparable to a 3,072-bit RSA key. Shorter keys mean faster operations, less computing power and bandwidth, and smaller certificates, which suits mobile devices, smart cards and IoT.

Common ECC algorithms include ECDHE for key agreement (used in nearly all modern TLS connections), ECDSA and EdDSA (Ed25519) for signatures. Like RSA, ECC is vulnerable to future large quantum computers. The following table compares approximate equivalent strengths.

Symmetric keyRSA keyECC key
80 bits (deprecated)1,024 bits160 bits
112 bits2,048 bits224 bits
128 bits3,072 bits256 bits
192 bits7,680 bits384 bits
256 bits15,360 bits512 bits or more (such as P-521)

Hybrid cryptography

Real systems combine the two approaches to get the best of each. In hybrid cryptography, asymmetric techniques securely establish a symmetric session key, and symmetric encryption then protects the data. The following steps show the pattern, as in a TLS connection or an encrypted email.

  1. Authenticate

    The server proves its identity with a certificate and a signature made with its private key.

  2. Agree a key

    Client and server use ephemeral (EC)DHE to agree on a shared secret, or the sender encrypts a random session key with the recipient's public key.

  3. Derive session keys

    Both derive symmetric session keys from the shared secret.

  4. Encrypt the data

    All further data is protected with an authenticated symmetric cipher such as AES-GCM.

The following comparison summarises symmetric and asymmetric cryptography.

Symmetric
KeysOne shared secret key
SpeedFast
Keys for n partiesn(n-1)/2
Main useBulk data encryption
ExamplesAES, ChaCha20
Asymmetric
KeysPublic and private key pair
SpeedSlow
Keys for n parties2n
Main useKey exchange and digital signatures
ExamplesRSA, Diffie-Hellman, ECC

The following diagram compares the number of keys needed for 200 branch systems to communicate in pairs with symmetric and asymmetric cryptography.

Keys needed for 200 branch systems to communicate in pairs. Symmetric keys for every pair need n(n−1)/2 = 200 × 199 / 2 = 19,900 keys, each distributed securely; asymmetric key pairs need 2n = 400 keys, with public keys shared through certificates. This is why hybrid schemes use asymmetric cryptography for key establishment.
The scenario is illustrative.
Put in order

Hybrid encryption

Exam skills 5.2.3

Put the steps of hybrid encryption in order.

Log in to try this activity Interactive activities are free with an account.
Worked example

Which key?

Alice wants to send Bob a confidential file and also prove that it came from her. Which keys does she use?

For confidentiality, Alice encrypts (in practice, a random symmetric key that encrypts the file) with Bob's public key, so only Bob's private key can decrypt it. For proof of origin, she signs a hash of the file with her own private key, and Bob verifies the signature with Alice's public key. A common exam trap is to suggest encrypting with Alice's private key for confidentiality; anyone with her public key could decrypt that.

Worked example

Scaling keys

A company with 200 branch systems wants each pair to communicate securely. How many keys are needed with symmetric keys for each pair, and with asymmetric key pairs?

Symmetric: n(n-1)/2 = 200 x 199 / 2 = 19,900 keys, each distributed securely. Asymmetric: 2n = 400 keys (200 key pairs), with public keys distributed through certificates. This is why asymmetric cryptography, usually in a hybrid scheme, is used for key establishment at scale.

Check yourself

Why should ECB mode not be used?

Show answer

It encrypts identical plaintext blocks to identical ciphertext blocks, revealing patterns in the data, and it provides no integrity.

Exam Tips

Remember for the exam

  • Encrypt for confidentiality with the recipient's public key; sign with your own private key.
  • n(n-1)/2 symmetric keys versus 2n asymmetric keys.
  • ECC gives equivalent strength with much shorter keys; avoid ECB mode; prefer AES-GCM.