Symmetric encryption: one shared key
Symmetric encryption uses one key, held by both sides, to lock a message and to open it again. It is like a strongbox with two identical keys: whoever holds a key can open it. It is the fast, strong workhorse that protects stored files and the bulk of every network connection. No background beyond the basic vocabulary is assumed. Its two difficulties, getting the key to the other side and counting how many keys a group needs, shape the rest of cryptography.
By the end of this unit you will be able to:
- Explain how symmetric encryption works and what it is good and bad at
- Tell apart DES, Triple DES, AES and the other named ciphers by key size, block size and status
- Explain why encrypting twice with DES adds almost no strength
- Explain a known-plaintext attack and how an attacker comes to hold plaintext
- Calculate how many keys a group needs with the formula n(n-1)/2
The password in the next email
An illustrative example
A solicitor has to send a client's property file to an estate agent. She puts it in an encrypted archive protected by a long password, and emails it.
The agent replies that he cannot open it. She sends a second email, one minute later, to the same address: the password.
The archive uses a cipher that nobody has broken. The firm's policy says client files must be encrypted in transit, and this one was.
If someone is reading the agent's mailbox, what has the encryption protected the file from?
One key locks and unlocks
In symmetric encryption the same key and . The sender and the recipient must both hold it, and nobody else may. It is also called secret-key or shared-key encryption.
A strongbox with two keys
Two branch managers each hold a key to the same strongbox. Either can lock papers in it and either can take them out. The box protects the papers on the road between the branches. It does nothing if a third key is cut, and it cannot show which of the two managers put a paper inside.
One shared key locks and unlocks, and must travel first
| Strength | Weakness |
|---|---|
| Fast: suited to large files and busy connections | The key must reach the other party secretly before any message can |
| Strong for its key length: a 128-bit key is beyond brute force | Every pair of parties needs its own key, so keys multiply |
| Simple to build into hardware and software | No proof of who wrote a message, because both parties hold the same key |
On its own it gives . and proof of origin need further tools.
The symmetric algorithms and their sizes
A block works in rounds. A round is one pass of substitution and over the block, using part of the key. More rounds mix the data more thoroughly.
| Algorithm | Key | Block | Standing |
|---|---|---|---|
| DES (Data Encryption Standard) | 56 bits, stored as 64 with 8 check bits | 64 bits | Broken by brute force. 16 rounds. Withdrawn in 2005 |
| Triple DES (3DES) | Two or three DES keys: 112 or 168 bits | 64 bits | Retired. Three-key strength is 112 bits |
| AES (Advanced Encryption Standard) | 128, 192 or 256 bits | 128 bits | The current standard. 10, 12 or 14 rounds |
| Blowfish | 32 to 448 bits | 64 bits | Old. Its designer recommends Twofish |
| Twofish | 128 to 256 bits | 128 bits | A finalist to become AES, not chosen |
| IDEA | 128 bits | 64 bits | Old and little used |
| RC4 | Variable | None: a | Broken. Banned from web encryption in 2015 |
| RC5 | Up to 2,040 bits | 32, 64 or 128 bits | Old. Key, block and rounds all adjustable |
| Skipjack | 80 bits | 64 bits | Disallowed. 32 rounds. Used in the Clipper chip, with a copy of each key held by the government |
AES is the cipher to choose. The United States standards body NIST ran an open competition and in 2000 selected a design called Rijndael, by Joan Daemen and Vincent Rijmen. It became AES in 2001.
Triple DES was the stopgap between DES and AES. NIST disallowed the two-key form for encryption, and disallowed the three-key form for encryption after 2023. Old data may still be decrypted with it.
Common misconception
“AES-256 encrypts 256 bits at a time.”
The number in AES-128, AES-192 and AES-256 is the key length. The block is 128 bits in all three.
Why double DES failed: meet in the middle
When 56 bits became too few, the obvious repair was to encrypt twice with two different DES keys. Two keys make 112 bits of key, so the work should have risen from 2^56 to 2^112. It did not.
The meet-in-the-middle attack needs one block of and its matching .
- Encrypt the plaintext with every possible first key, and store all 2^56 results.
- Decrypt the ciphertext with every possible second key, another 2^56 operations.
- Look for a value that appears in both lists. The pair of keys that produced it is the pair in use.
The attacker has done about 2^57 operations, not 2^112. Encrypting twice added one bit of strength.
Triple DES therefore uses three operations: encrypt with the first key, decrypt with the second, encrypt with the third. With three independent keys it holds 168 bits of key, and the same attack leaves it 112 bits of strength. The two-key form, which reuses the first key as the third, is rated at 80 bits or less.
Variants are named by their steps and key count. DES-EDE3 and DES-EEE3 use three different keys. DES-EDE2 and DES-EEE2 use two, with the first key used again for the third step. EEE encrypts three times; EDE encrypts, decrypts, encrypts. If all three keys are the same, EDE is ordinary single DES.
Common misconception
“Meet-in-the-middle is another name for man-in-the-middle.”
Meet-in-the-middle is arithmetic against a cipher applied twice. A man-in-the-middle is a person or system placed between two parties on a network, relaying and altering their messages.
Known plaintext: the attacker holds a matching pair
In a known-plaintext attack the attacker holds some ciphertext and the plaintext that produced it. The aim is to work out the key, and with it to read everything else encrypted under that key.
Matching plaintext is easier to come by than it sounds.
- Many messages begin with the same words: a standard greeting, a letterhead, a legal notice.
- Files of one type start with the same fixed bytes.
- A message sent encrypted today is published tomorrow: a press release, a set of results.
- A stolen laptop holds the unencrypted copy of a file that was also sent encrypted.
The attacker holds more than in a ciphertext-only attack, so the attack is easier to carry out. In the next position up, chosen plaintext, the attacker picks the plaintext and has it encrypted.
Meet-in-the-middle is a known-plaintext attack. A modern cipher such as AES is designed so that even a very large amount of known plaintext does not reveal the key. The practical defences are to use such a cipher and to change keys on a schedule, which limits what any one key protects.
Sharing the key, and counting the keys
The key distribution problem is this: before two parties can exchange a secret message, they must already share a . Sending the key along the same route as the message protects nothing, because whoever can read one can read the other.
The traditional answer is out-of-band distribution: the key travels by a different route from the data. It is read over the telephone, carried by courier or handed over in person.
The second difficulty is number. Each pair of people who want from everyone else needs its own key.
Symmetric keys needed by a group
Keys = n × (n − 1) ÷ 2
- n
- The number of people or systems that must each be able to talk privately to every other one.
Ten people need 10 × 9 ÷ 2 = 45 keys. Each of them holds 9.
The total grows with the square of the group. A thousand people need 499,500 keys. Both difficulties are answered by a different kind of , which uses a pair of keys.
Worked example: A firm that grows from 5 offices to 11
A firm encrypts the links between its offices with . Every office has a direct link to every other office, and each link has its own key.
- With 5 offices: 5 × 4 ÷ 2 = 10 keys.
- With 10 offices: 10 × 9 ÷ 2 = 45 keys. Doubling the offices has more than quadrupled the keys.
- An eleventh office opens: 11 × 10 ÷ 2 = 55 keys. One new office needs 10 new keys, one for each office already there.
- Each of those 10 keys must be delivered out-of-band to two places, and all 55 must be replaced on a schedule.
The arithmetic is why large organisations do not hand out symmetric keys pair by pair. They use symmetric encryption for the data and another method to deliver the keys.
A question, worked through
A security manager at a building society finds that the nightly file transfer to its card processor is encrypted with three-key Triple DES. The processor offers AES-256 at no charge, but the change needs a weekend of joint testing. The operations lead objects that three 56-bit keys make 168 bits, which is more than the 128 bits of the smallest AES key, so nothing needs to change.
What is the BEST response?
Decide on your answer, then open the reasoning
- The question asks whether the operations lead's arithmetic holds, and what follows from the answer.
- Rule out d. It reaches the right action from a false fact: Triple DES is a block cipher with a 64-bit block.
- Rule out c. The meet-in-the-middle attack shows that repeated passes do not each add their full key length, and a four-pass DES is no standard at all.
- Between a and b: b counts key bits. Strength is measured by the best attack, and meet-in-the-middle leaves three-key Triple DES with 112 bits.
- The standards body has also disallowed Triple DES for new encryption since the end of 2023, and the replacement is free. Option a is the answer.
Answer: A. Plan the move to AES, because Triple DES gives 112 bits of strength at most and is retired for new encryption
Choosing between good answers
- A question asks how many keys a group of n needs and offers both n(n-1)/2 and 2n
- n(n-1)/2 is the symmetric answer. 2n belongs to public key cryptography.
- An option claims that encrypting twice doubles the strength
- reject it. Meet-in-the-middle means double encryption adds about one bit, which is why Triple DES has three steps and 112 bits of strength.
- A scenario gives the attacker an encrypted file and its original
- the attack is known plaintext. If the attacker chose the content, it is chosen plaintext.
- Two options are both sound ciphers and one is AES
- choose AES unless the scenario gives a reason against it. It is the current standard.
- A question asks how to deliver a symmetric key safely
- choose a route separate from the data: out-of-band.
Check your understanding
4 questions on this unit, easiest first. Confirm an answer to see the reasoning for it, then the right answer, the other options and the rule to reuse. Your answers are kept in this browser and feed readiness and review.
These questions are drafts that no named reviewer has approved yet.
Question 1 of 4
What to remember
- Symmetric encryption uses one shared key to encrypt and decrypt. It is fast and strong, and it gives confidentiality.
- DES: 56-bit key, 64-bit block, broken. Triple DES: 112 bits of strength, retired. AES: 128, 192 or 256-bit keys, 128-bit block, current.
- Meet-in-the-middle is why double DES adds almost nothing. It is not man-in-the-middle.
- In a known-plaintext attack the attacker holds ciphertext and its matching plaintext and seeks the key.
- A group of n needs n(n-1)/2 symmetric keys: 45 for ten people, 499,500 for a thousand.
- The key must reach the other party by a separate, safe route: out-of-band.
Say it from memory
What does the attacker hold in a known-plaintext attack, what is the aim, and what is a classic example?
Some ciphertext and the plaintext that produced it, for example a standard heading or a file later published. The aim is to find the key and so read everything else under it. Meet-in-the-middle against double DES is a known-plaintext attack. The attacker holds more than in a ciphertext-only attack and less than in a chosen-plaintext attack.
What does symmetric encryption give on its own, and what are its three weaknesses?
On its own it gives confidentiality. The key must reach the other party secretly before any message can. Every pair of parties needs its own key, so keys multiply. It gives no proof of who wrote a message, because both parties hold the same key.
Give the key size, block size and rounds of DES and of AES.
DES uses a 56-bit key, stored as 64 with 8 check bits, a 64-bit block and 16 rounds; it was withdrawn in 2005. AES uses a 128, 192 or 256-bit key, a 128-bit block in all three, and 10, 12 or 14 rounds. AES was Rijndael, selected by NIST in 2000.
Why did double DES add only one bit of strength, and what strength does three-key Triple DES keep?
The meet-in-the-middle attack encrypts a known plaintext under every first key, decrypts the ciphertext under every second key, and looks for a value in both lists: about 2^57 operations, not 2^112. Three-key Triple DES holds 168 bits of key, and the same attack leaves it 112 bits of strength.
What is the key distribution problem, and how many symmetric keys does a group of n people need?
Before two parties can exchange a secret message, they must already share a secret key; the traditional answer is out-of-band distribution by a different route. A group needs n × (n − 1) ÷ 2 keys, so ten people need 45 keys and a thousand need 499,500.
Sources
- FIPS 46-3: Data Encryption Standard (DES), NISTDES with a 64-bit key of which 56 bits are used, a 64-bit block and 16 rounds, its withdrawal in 2005, and Triple DES as encrypt, decrypt, encrypt with two or three independent keys.
- NIST SP 800-57 Part 1 Rev. 5: Recommendation for Key Management, NISTThree-key Triple DES rated at 112 bits of security strength and two-key Triple DES at 80 bits or less.
- NIST SP 800-131A Rev. 2: Transitioning the Use of Cryptographic Algorithms and Key Lengths, NISTTwo-key Triple DES disallowed for encryption, three-key Triple DES disallowed for encryption after 2023 with decryption allowed for legacy use, and Skipjack disallowed.
- FIPS 197: Advanced Encryption Standard, NISTAES as Rijndael, selected in 2000, with a 128-bit block, keys of 128, 192 and 256 bits and 10, 12 and 14 rounds.
- The Blowfish Encryption Algorithm, Bruce SchneierBlowfish with a 64-bit block and a key of 32 to 448 bits, and its designer's recommendation of Twofish.
- Twofish, Bruce SchneierTwofish with a 128-bit block and keys of 128 to 256 bits, an AES finalist that was not selected.
- RFC 5469: DES and IDEA Cipher Suites for Transport Layer Security (TLS), IETFIDEA with a 128-bit key and 64-bit blocks.
- RFC 7465: Prohibiting RC4 Cipher Suites, IETFRC4 as a stream cipher prohibited in TLS since 2015.
- SKIPJACK and KEA Algorithm Specifications, Version 2.0, NISTSkipjack as a 64-bit block cipher with an 80-bit key and 32 steps, supported in the Clipper chip.
- RFC 2040: The RC5, RC5-CBC, RC5-CBC-Pad, and RC5-CTS Algorithms, IETFRC5 with blocks of 32, 64 or 128 bits, an adjustable number of rounds and a key of up to 255 bytes.
- FIPS 185: Escrowed Encryption Standard, NISTThe Escrowed Encryption Standard: a key escrow system that lets the government decrypt protected telecommunications.