A key schedule is a critical component of any block cipher - it's the algorithm that expands the master key into the round keys used in each iteration of the cipher. A poorly designed key schedule can undermine the entire cipher's security, even if the round function is strong.
Here are the essential properties a good key schedule should have:
1. Sufficient Diffusion
The key schedule must ensure that every bit of the master key influences many bits across all round keys. This prevents attacks that exploit weak key bits or attempt to recover portions of the key independently.
- One-way dependency: A single bit change in the master key should affect approximately half the bits in each round key (avalanche effect)
- Inter-round diffusion: Changes should propagate across multiple rounds, not just within individual round keys
2. Resistance to Related-Key Attacks
Related-key attacks exploit mathematical relationships between keys that produce predictable differences in round keys. A good key schedule prevents these by ensuring that:
- Small differences in master keys lead to unpredictable, large differences in round keys
- No simple mathematical relationships exist between round keys derived from related master keys
- The key schedule itself acts as a pseudo-random function with respect to key differences
This is particularly important for ciphers used in hash function constructions or certain modes of operation.
3. Resistance to Slide Attacks
Slide attacks exploit self-similarity in the cipher structure. The key schedule must ensure that:
- Round keys are sufficiently different from each other
- No periodic or repetitive patterns exist in the round key sequence
- Round constants or other asymmetric elements break any potential sliding relationships
4. Efficient Forward Computation
For encryption performance:
- The key schedule should be computationally efficient
- Round keys should be computable in sequence without excessive memory or computation
- Ideally, round key generation can be parallelized or pipelined
5. Efficient Backward Computation (Invertibility)
For decryption in ciphers that require reverse round keys:
- The key schedule should be efficiently invertible
- Decryption round keys should be derivable either by running the key schedule backward or through a simple transformation
- Memory requirements for storing or computing decryption keys should be reasonable
6. No Weak Keys
The key schedule must ensure that:
- No keys exist that produce identical or trivially related round keys
- No keys create fixed points or short cycles in the cipher
- The effective key space remains the full advertised size (e.g., truly 2^128 for a 128-bit key)
- Semi-weak key pairs (where E_k1(E_k2(x)) = x) are avoided
7. No Equivalent Keys
Different master keys should never produce identical sets of round keys. This includes:
- No key complementation properties (where K and ~K produce related encryptions)
- No rotational equivalence or other simple transformations that preserve round key relationships
8. Resistance to Key Schedule Attacks
The key schedule should resist specific attacks targeting its structure:
- Meet-in-the-middle attacks on the key schedule: The computation shouldn't be separable into independent parts
- Differential attacks on the key schedule: High-probability differential characteristics should not exist
- Algebraic attacks: The key schedule should have high algebraic degree and resist linearization
9. Implementation Security
Practical security considerations include:
- Side-channel resistance: The key schedule should avoid data-dependent operations that could leak information through timing, power, or electromagnetic channels
- Constant-time execution: All operations should take the same time regardless of key values
- No exploitable tables: S-boxes or other lookup tables in the key schedule should resist cache-timing attacks
10. Agility
For ciphers supporting multiple key sizes:
- The key schedule should efficiently handle different key lengths
- Security properties should scale appropriately with key size
- Longer keys should provide proportionally more security without introducing new weaknesses
Examples and Trade-offs
AES Key Schedule: Provides good diffusion and efficiency but has been criticized for its relatively simple structure, which enabled some related-key attacks (though these don't threaten AES in practice).
Serpent Key Schedule: Uses a more complex approach with better diffusion but requires more computation.
PRESENT Key Schedule: Optimized for hardware efficiency while maintaining essential security properties.
The design of a key schedule often involves trade-offs between security margins, performance, and implementation complexity. Modern ciphers tend to err on the side of stronger, more complex key schedules to provide defense in depth against future cryptanalytic advances.