YourNextCert™ with Shubham Sharma

Chapter 6

Cryptography and Symmetric Key Algorithms

Cryptographic foundations: goals, terminology, the maths behind ciphers, one-time pads, key length and work factor, symmetric algorithms, block cipher modes, key management and the cryptographic lifecycle.

Status
In progress
Last updated

Video

The video for this chapter is not available yet.

Exam domains and objectives covered

Domain 3: Security Architecture and Engineering

  • 3.5 Assess and mitigate the vulnerabilities of security architectures, designs, and solution elements
  • 3.6 Select and determine cryptographic solutions

Objectives are numbered as in the official ISC2® CISSP exam outline.

Learning objectives

By the end of this chapter you should be able to:

  • Explain how cryptography supports confidentiality, integrity, authentication and nonrepudiation
  • Use core cryptographic terminology correctly, including key space, work factor, nonce, IV and Kerckhoffs' principle
  • Apply the basic operations behind ciphers: XOR, modulo arithmetic, one-way functions, confusion and diffusion
  • Compare codes and ciphers, substitution and transposition, stream and block ciphers, and state the one-time pad requirements
  • Contrast symmetric and asymmetric cryptography, including key counts and hybrid cryptography
  • Recall block and key sizes of common symmetric algorithms and the properties of each block cipher mode
  • Manage symmetric keys and the cryptographic lifecycle, including escrow, M of N control and algorithm governance

Key topics

  • Goals of cryptography
  • Kerckhoffs' principle
  • XOR and modulo
  • Codes vs ciphers
  • One-time pad
  • Confusion and diffusion
  • Split knowledge and M of N control
  • Work factor
  • Symmetric vs asymmetric
  • AES, DES and 3DES
  • Block cipher modes
  • Key management
  • Cryptographic lifecycle

Chapter notes

Chapter overview

Cryptography underpins almost every modern security control, from disk encryption to secure web browsing. This chapter builds the vocabulary and mental models you need, then focuses on symmetric (shared secret key) algorithms: how they work, which ones you must recognise, how their modes of operation differ and how their keys are managed. Chapter 7 continues with public key cryptography, hashing, PKI and attacks on cryptosystems.

The exam rarely asks you to do cryptography by hand. It does expect you to choose the right tool, spot a weak configuration and know the numbers (block sizes, key sizes, key counts).

Key concepts

What cryptography achieves

Goal What it gives you Typical mechanism
Confidentiality Keeps data secret whether stored, moving or being processed Symmetric or asymmetric encryption
Integrity Detection of any change, deliberate or accidental Hashes, MACs, digital signatures, authenticated modes
Authentication Proof of identity, for example challenge-response using a shared secret Shared keys, certificates
Nonrepudiation Proof of who sent a message, so they can’t deny it Digital signatures (asymmetric only)

Not every cryptosystem aims at all four. With symmetric encryption both parties hold the same key, so either could have produced a message; that’s why symmetric cryptography can never give nonrepudiation.

Vocabulary

  • Plaintext (P) is converted by an algorithm and a key into ciphertext (C); decryption reverses it.
  • Key space: the set of possible keys. An n-bit key gives 2ⁿ possibilities, so every extra bit doubles the work for a brute-force attacker.
  • Kerckhoffs’ principle: a system should stay secure even if everything except the key is public. Open algorithms attract scrutiny and get stronger; secret algorithms are security through obscurity.
  • Cryptography creates ciphers; cryptanalysis breaks them; together they form cryptology. A cryptosystem is a specific implementation in hardware or software. Keys are sometimes called cryptovariables.
  • FIPS 140-3 sets the security requirements for cryptographic modules used by the US government.
  • Work factor (work function): the time and cost needed to break a system, usually by brute force. It only needs to exceed the period for which the data stays valuable, but you must allow for faster hardware, new cryptanalysis and, eventually, quantum computing.

The maths you need

  • Boolean operations: AND (true only if both inputs are true), OR (true if either is), NOT (inverts) and XOR (true if exactly one input is true). XOR matters most: applying the same key twice returns the original value, which makes it ideal for encryption. Example: 1100 XOR 1010 = 0110, and 0110 XOR 1010 = 1100 again.
  • Modulo: the remainder after division. 17 mod 5 = 2; 9 mod 9 = 0. It makes values wrap around, as in alphabet shifts and RSA.
  • One-way function: easy to compute, infeasible to reverse (multiplying large primes versus factoring the product). No function has been proven one-way.
  • Nonce: a number used once to add randomness. An initialisation vector (IV) is a nonce, usually block-sized, that makes identical plaintexts encrypt differently under the same key.
  • Zero-knowledge proof: proving you know a secret without revealing it.
  • Split knowledge: no single person holds enough information to perform a sensitive operation. M of N control requires at least M of N authorised people (for example 3 of 8 recovery agents) to act together.
  • Confusion hides the relationship between key and ciphertext (typically via substitution); diffusion spreads the effect of one plaintext change across many ciphertext bits (typically via transposition).

Codes and ciphers

Codes replace whole words or phrases with symbols (“10-4” for “message received”) and aren’t always secret. Ciphers always aim to hide meaning and work on bits, characters or blocks.

Cipher type How it works Weakness or note
Transposition Rearranges characters, for example columnar transposition driven by a keyword Letter frequencies are unchanged
Substitution (monoalphabetic) Replaces each character, as in the Caesar cipher (shift of three, also called ROT3: ATTACK becomes DWWDFN) Broken by frequency analysis
Polyalphabetic Uses several alphabets selected by a keyword, as in the Vigenère cipher Vulnerable to period analysis of the repeating key
Running key (book cipher) Key is as long as the message, taken from an agreed text Key isn’t random
One-time pad (Vernam cipher) Each character combined with a fresh key character (C = P XOR K) Unbreakable only if the rules below are met
Stream Encrypts one bit or character at a time Fast, suits real-time data
Block Encrypts fixed-size chunks Most modern algorithms are block ciphers

One-time pad rules: the key must be truly random, at least as long as the message, used only once and physically protected. Break any rule and the pad can be attacked; the US VENONA project read Soviet traffic because the key material wasn’t truly random. Distributing such long keys is the practical obstacle.

Symmetric vs asymmetric

Symmetric Asymmetric
Keys One shared secret Public/private pair per user
Speed Fast (often thousands of times faster); suits hardware and bulk encryption Slow
Key distribution Hard; needs an out-of-band or protected channel Easy; publish the public key
Scalability Poor: n(n−1)/2 keys Good: 2n keys
Leaving users Every key they knew must be replaced Revoke just their key pair
Services Confidentiality (plus integrity and authentication with MACs or authenticated modes) Confidentiality, integrity, authentication and nonrepudiation

Example: 20 users need 190 symmetric keys but only 40 asymmetric keys. Hybrid cryptography (as in TLS) uses asymmetric methods to agree a temporary ephemeral symmetric session key, then switches to fast symmetric encryption.

Watch the wording: “private key” alone means the private half of an asymmetric pair, but “private key cryptography” and “secret key cryptography” both mean symmetric cryptography.

Hashing produces a fixed-length digest of a message. A good hash can’t be reversed and rarely produces the same digest for two inputs (a collision); algorithms with practical collisions are retired. Hashes feed digital signatures (Chapter 7).

Symmetric algorithms to recognise

Algorithm Block size (bits) Key size (bits) Status and notes
AES (Rijndael) 128 128, 192, 256 Current standard (FIPS 197, 2001); 10, 12 or 14 rounds depending on key size
DES 64 56 (64 including parity) 16 rounds; broken by brute force
3DES 64 112 or 168 (effective strength about 112) Disallowed for US federal use after 2023; Double DES was abandoned because of the meet-in-the-middle attack
IDEA 64 128 Used in early PGP; patents have expired
Blowfish 64 32–448 Fast, free to use
Skipjack 64 80 NSA design for the Clipper chip, with built-in key escrow
RC4 Stream 40–2,048 Broken; removed from TLS; caused weaknesses in WEP and early WPA
RC5 32, 64 or 128 0–2,040 Unrelated to RC4
RC6 128 128, 192, 256 AES finalist, little used
CAST-128 / CAST-256 64 / 128 40–128 / 128–256 Feistel-network designs; CAST-256 was an AES candidate

Modern stream encryption typically uses ChaCha20 or AES in counter-based modes instead of RC4.

Block cipher modes

Mode How it works Points to remember
ECB (Electronic Codebook) Each block encrypted independently with the same key Identical plaintext blocks give identical ciphertext, revealing patterns; avoid for anything but tiny values
CBC (Cipher Block Chaining) Each plaintext block XORed with the previous ciphertext block; first block uses an IV Errors spread to the next block; can’t be parallelised for encryption
CFB (Cipher Feedback) Streaming version of CBC, encrypting buffers as they fill Uses an IV and chaining
OFB (Output Feedback) XORs plaintext with a keystream generated from the IV, independent of the data No chaining; transmission errors don’t spread
CTR (Counter) XORs plaintext with encrypted counter values Errors don’t spread; parallelises well
GCM (Galois/Counter) CTR plus an authentication tag Authenticated encryption: confidentiality and integrity
CCM (Counter with CBC-MAC) CTR for confidentiality plus CBC-MAC for authenticity Authenticated; used with 128-bit block ciphers and a fresh nonce each time

ECB, CBC, CFB, OFB and CTR are unauthenticated: they protect confidentiality only. Never reuse a nonce or IV with the same key in counter-based modes.

Symmetric key management

  • Creation: generate keys with as much randomness as possible across the whole key space.
  • Distribution: three options. Offline (physical handover, secure but slow and at risk of loss or interception), public key encryption (wrap the secret key with the recipient’s public key) or a key exchange protocol such as Diffie–Hellman.
  • Storage: never keep a key on the same system as the data it protects. Options are software (simple but exposed if the host is compromised), hardware (smartcards, tokens and hardware security modules (HSMs), more secure but costlier) and cloud key management backed by provider HSMs.
  • Change and destruction: when someone who knew a key leaves, replace the key and re-encrypt the data. Destroy retired keys securely.
  • Escrow and recovery: government escrow proposals (the Escrowed Encryption Standard behind the Clipper chip, and fair cryptosystems that split keys among independent third parties) never won public acceptance. Inside organisations, recovery agents let you reach a departed employee’s data, ideally under M of N control so no single agent can act alone.

The cryptographic lifecycle

Apart from the one-time pad, every cryptosystem eventually weakens as computing power grows and cryptanalysis improves. Algorithm and protocol governance should:

  • list the algorithms the organisation accepts (for example AES, RSA, ECC);
  • set minimum key lengths according to data sensitivity;
  • name approved protocols (for example TLS 1.2 or 1.3);
  • review these choices regularly and retire weak options such as DES, 3DES and RC4;
  • match protection to how long the data must stay secret: next week’s plans need far less than long-lived state secrets.

Plan for post-quantum cryptography. NIST published its first post-quantum standards (FIPS 203, 204 and 205) in 2024; a large quantum computer would mainly threaten today’s public key algorithms, while symmetric ciphers stay safe with longer keys such as AES-256.

Weaknesses in cryptographic systems

Most real failures come from implementation rather than the maths: deprecated algorithms, short keys, ECB mode, reused nonces or IVs, poor random number generation, keys stored beside the data, and missing integrity protection. These are what objective 3.5 asks you to assess and mitigate.

Exam tips

  • If a question needs nonrepudiation, symmetric encryption alone is never the answer.
  • Count symmetric keys with n(n−1)/2 and asymmetric keys with 2n.
  • ECB is the mode to avoid; GCM is the modern choice when integrity matters too.
  • Strength depends on the secrecy of the key, not of the algorithm.
  • AES block size is always 128 bits, whatever the key length; DES uses a 56-bit key and 64-bit block.
  • Longer keys raise the work factor; the required work factor depends on how long the data stays valuable.

Common traps

  • Codes vs ciphers: codes swap words and phrases; ciphers transform characters, bits or blocks.
  • Caesar vs Vigenère vs one-time pad: the same idea with a key of length one, a repeating word, and a random key as long as the message.
  • DES key length: 56 effective bits, even though the specification mentions 64.
  • 3DES strength: 168 bits of key material, but only about 112 bits of effective security.
  • RC5 is not RC4’s successor: different designs entirely.
  • Private key vs private key cryptography: the first is asymmetric, the second symmetric.
  • OFB and CTR don’t propagate errors; CBC does.

Quick revision

  • Goals: confidentiality, integrity, authentication, nonrepudiation (asymmetric only).
  • Key space 2ⁿ; Kerckhoffs: only the key is secret.
  • XOR is reversible; modulo wraps values; nonces and IVs add uniqueness.
  • One-time pad: random, as long as the message, used once, protected.
  • Symmetric: fast, n(n−1)/2 keys. Asymmetric: slow, 2n keys. Hybrid combines both.
  • AES 128-bit block, 128/192/256-bit keys; DES 64/56; 3DES 112 effective; IDEA 64/128; Blowfish 64/32–448; Skipjack 64/80.
  • Modes: ECB weak; CBC chains; CFB, OFB, CTR stream; GCM and CCM authenticate.
  • Store keys away from data, ideally in HSMs; use M of N control for recovery.

Key terms

Term Meaning
Authenticated encryption A mode that provides both confidentiality and integrity, such as GCM
Confusion Making the key-to-ciphertext relationship complex
Diffusion Spreading the influence of each plaintext bit across the ciphertext
Ephemeral key A temporary key used for a single session
Hardware security module (HSM) Tamper-resistant hardware that generates, stores and uses keys
Hybrid cryptography Using asymmetric methods to establish a symmetric session key
Initialisation vector (IV) A random or unique value that makes repeated encryptions differ
Kerckhoffs’ principle A cryptosystem must stay secure when everything but the key is public
Key escrow Holding a copy of a key with a trusted party for later recovery
Key space The full range of possible keys for an algorithm
M of N control Requiring a minimum number of authorised people to act together
One-time pad A cipher using a random, single-use key at least as long as the message
Work factor The effort needed to defeat a cryptosystem
XOR A bitwise operation that outputs true only when inputs differ

Sources