Intro Repairing GCM Simeck Design Summery
Revisiting Counter Mode to Repair Galois/Counter Mode
Bo Zhu, Yin Tan and Guang Gong University of Waterloo, Canada
Aug 12, 2013
1 of 32 Revisiting CM to Repair GCM
Revisiting Counter Mode to Repair Galois/Counter Mode Bo Zhu, Yin - - PowerPoint PPT Presentation
Intro Repairing GCM Simeck Design Summery Revisiting Counter Mode to Repair Galois/Counter Mode Bo Zhu, Yin Tan and Guang Gong University of Waterloo, Canada Aug 12, 2013 1 of 32 Revisiting CM to Repair GCM Intro Repairing GCM Simeck
Intro Repairing GCM Simeck Design Summery
Aug 12, 2013
1 of 32 Revisiting CM to Repair GCM
Intro Repairing GCM Simeck Design Summery
Aug 12, 2013
2 of 32 Revisiting CM to Repair GCM, and Simeck
Intro Repairing GCM Simeck Design Summery
◮ To study existing modes of operations
◮ Before designing authenticated ciphers 3 of 32 Revisiting CM to Repair GCM, and Simeck
Intro Repairing GCM Simeck Design Summery
◮ To study existing modes of operations
◮ Before designing authenticated ciphers ◮ Recent attacks on GCM ◮ A flaw found in GCM’s security proofs in Crypto’12 ◮ Forgery attacks in FSE’12 and FSE’13 3 of 32 Revisiting CM to Repair GCM, and Simeck
Intro Repairing GCM Simeck Design Summery
◮ To study existing modes of operations
◮ Before designing authenticated ciphers ◮ Recent attacks on GCM ◮ A flaw found in GCM’s security proofs in Crypto’12 ◮ Forgery attacks in FSE’12 and FSE’13
◮ To study lightweight cipher designs
◮ To use with mode of operation 3 of 32 Revisiting CM to Repair GCM, and Simeck
Intro Repairing GCM Simeck Design Summery
◮ To study existing modes of operations
◮ Before designing authenticated ciphers ◮ Recent attacks on GCM ◮ A flaw found in GCM’s security proofs in Crypto’12 ◮ Forgery attacks in FSE’12 and FSE’13
◮ To study lightweight cipher designs
◮ To use with mode of operation ◮ Two block ciphers designed by people from NSA 3 of 32 Revisiting CM to Repair GCM, and Simeck
Intro Repairing GCM Simeck Design Summery
4 of 32 Revisiting CM to Repair GCM, and Simeck
Intro Repairing GCM Simeck Design Summery
5 of 32 Revisiting CM to Repair GCM, and Simeck
Intro Repairing GCM Simeck Design Summery
◮ One design of AEAD by McGrew and Viega in 2005
◮ Counter Mode (CM) for encryption ◮ Galois MAC (GMAC) for authentication
◮ GCM comparing to CCM (CM + CBC-MAC)
◮ Less popular than CCM for historical reasons ◮ Supported by OpenSSH from v6.2 (March 2013) ◮ Incluced in NSA Suite B (CCM isn’t in) ◮ Suite A is classified ◮ Parallelizable computation 6 of 32 Revisiting CM to Repair GCM, and Simeck
Intro Repairing GCM Simeck Design Summery
◮ Authentication key: H = EK(0)
The image is from Procter and Cid’s slides in FSE’13. 7 of 32 Revisiting CM to Repair GCM, and Simeck
Intro Repairing GCM Simeck Design Summery
◮ GMAC = GHASH(H, A, C) + EK(IV ) ◮ GHASH
m
◮ Note: constant term is zero
8 of 32 Revisiting CM to Repair GCM, and Simeck
Intro Repairing GCM Simeck Design Summery
The image is from Saarinen’s paper in FSE’12. 9 of 32 Revisiting CM to Repair GCM, and Simeck
Intro Repairing GCM Simeck Design Summery
◮ Initial counter
◮ N0 = IV ||032, if len(IV ) = 96 ◮ N0 = GHASHH(IV ), if len(IV ) = 96 10 of 32 Revisiting CM to Repair GCM, and Simeck
Intro Repairing GCM Simeck Design Summery
◮ Initial counter
◮ N0 = IV ||032, if len(IV ) = 96 ◮ N0 = GHASHH(IV ), if len(IV ) = 96
◮ Generating counters
10 of 32 Revisiting CM to Repair GCM, and Simeck
Intro Repairing GCM Simeck Design Summery
◮ Initial counter
◮ N0 = IV ||032, if len(IV ) = 96 ◮ N0 = GHASHH(IV ), if len(IV ) = 96
◮ Generating counters
◮ Security of GCM highly depends the prob of counter collisions
◮ N′
0 = N′′ 0 ,
N′
r1 = N′′ r2
10 of 32 Revisiting CM to Repair GCM, and Simeck
Intro Repairing GCM Simeck Design Summery
◮ Initial counter
◮ N0 = IV ||032, if len(IV ) = 96 ◮ N0 = GHASHH(IV ), if len(IV ) = 96
◮ Generating counters
◮ Security of GCM highly depends the prob of counter collisions
◮ N′
0 = N′′ 0 ,
N′
r1 = N′′ r2
◮ if len(IV ) = 96,
GHASH(IV1) = GHASH(IV2), GHASH(IV1) ⊞ r1 = GHASH(IV2) ⊞ r2
10 of 32 Revisiting CM to Repair GCM, and Simeck
Intro Repairing GCM Simeck Design Summery
◮ Initial counter
◮ N0 = IV ||032, if len(IV ) = 96 ◮ N0 = GHASHH(IV ), if len(IV ) = 96
◮ Generating counters
◮ Security of GCM highly depends the prob of counter collisions
◮ N′
0 = N′′ 0 ,
N′
r1 = N′′ r2
◮ if len(IV ) = 96,
GHASH(IV1) = GHASH(IV2), GHASH(IV1) ⊞ r1 = GHASH(IV2) ⊞ r2
◮ GHASH(IV1) ⊞ (r1 − r2) = GHASH(IV2) 10 of 32 Revisiting CM to Repair GCM, and Simeck
Intro Repairing GCM Simeck Design Summery
11 of 32 Revisiting CM to Repair GCM, and Simeck
Intro Repairing GCM Simeck Design Summery
11 of 32 Revisiting CM to Repair GCM, and Simeck
Intro Repairing GCM Simeck Design Summery
◮ For a randomly chosen H, the collision prob is
11 of 32 Revisiting CM to Repair GCM, and Simeck
Intro Repairing GCM Simeck Design Summery
◮ For a randomly chosen H, the collision prob is
◮ In the original security proofs of GCM, it was believed
11 of 32 Revisiting CM to Repair GCM, and Simeck
Intro Repairing GCM Simeck Design Summery
◮ For a randomly chosen H, the collision prob is
◮ In the original security proofs of GCM, it was believed
11 of 32 Revisiting CM to Repair GCM, and Simeck
Intro Repairing GCM Simeck Design Summery Provable Security Reparing GCM
12 of 32 Revisiting CM to Repair GCM, and Simeck
Intro Repairing GCM Simeck Design Summery Provable Security Reparing GCM
◮ Pointed out by Iwata et al. in Crypto’12 ◮ Nr ⊞ 1 is non-linear in Galois field ◮
13 of 32 Revisiting CM to Repair GCM, and Simeck
Intro Repairing GCM Simeck Design Summery Provable Security Reparing GCM
◮ Pointed out by Iwata et al. in Crypto’12 ◮ Nr ⊞ 1 is non-linear in Galois field ◮
◮ Much more solutions than expected
◮ αr times more solutions
◮ for r < 232, αr is up to 222
13 of 32 Revisiting CM to Repair GCM, and Simeck
Intro Repairing GCM Simeck Design Summery Provable Security Reparing GCM
◮ New security bounds of GCM were also given by Iwata et al.
◮ for both of privacy (encryption) and authenticity (MAC) ◮ almost 222 looser than originally claimed 14 of 32 Revisiting CM to Repair GCM, and Simeck
Intro Repairing GCM Simeck Design Summery Provable Security Reparing GCM
◮ New security bounds of GCM were also given by Iwata et al.
◮ for both of privacy (encryption) and authenticity (MAC) ◮ almost 222 looser than originally claimed
◮ It would be better to repair GCM s.t.
◮ retain the original bounds, and ◮ leave original proofs largely unchanged ◮ with a small fix to the original design 14 of 32 Revisiting CM to Repair GCM, and Simeck
Intro Repairing GCM Simeck Design Summery Provable Security Reparing GCM
◮ In CM, counter is incremented by 1, i.e.
15 of 32 Revisiting CM to Repair GCM, and Simeck
Intro Repairing GCM Simeck Design Summery Provable Security Reparing GCM
◮ In CM, counter is incremented by 1, i.e.
◮ CM is secure if next() outputs uniquely
◮ next() is indistinguishable if the underlying block cipher is
secure
15 of 32 Revisiting CM to Repair GCM, and Simeck
Intro Repairing GCM Simeck Design Summery Provable Security Reparing GCM
◮ In CM, counter is incremented by 1, i.e.
◮ CM is secure if next() outputs uniquely
◮ next() is indistinguishable if the underlying block cipher is
secure
◮ McGrew, Counter Mode Security: Analysis and
◮ The details of the next-counter function are unimportant; ◮ That function does not provide any security properties other
than the uniqueness of the inputs to the block cipher.
15 of 32 Revisiting CM to Repair GCM, and Simeck
Intro Repairing GCM Simeck Design Summery Provable Security Reparing GCM
◮ In CM, counter is incremented by 1, i.e.
◮ CM is secure if next() outputs uniquely
◮ next() is indistinguishable if the underlying block cipher is
secure
◮ McGrew, Counter Mode Security: Analysis and
◮ The details of the next-counter function are unimportant; ◮ That function does not provide any security properties other
than the uniqueness of the inputs to the block cipher.
◮ Design a different next() to “fix” GCM?
15 of 32 Revisiting CM to Repair GCM, and Simeck
Intro Repairing GCM Simeck Design Summery Provable Security Reparing GCM
◮ non-repeating 16 of 32 Revisiting CM to Repair GCM, and Simeck
Intro Repairing GCM Simeck Design Summery Provable Security Reparing GCM
◮ non-repeating
◮ To reduce counter collision probability 16 of 32 Revisiting CM to Repair GCM, and Simeck
Intro Repairing GCM Simeck Design Summery Provable Security Reparing GCM
◮ non-repeating
◮ To reduce counter collision probability
◮ e.g., f (x) ⊞ r1 = g(x) ⊞ r2 ⇔ f (x) ⊞ (r1 ⊟ r2) = g(x) ◮ to keep the original proofs largely unchanged 16 of 32 Revisiting CM to Repair GCM, and Simeck
Intro Repairing GCM Simeck Design Summery Provable Security Reparing GCM
◮ addition, i.e. XOR
17 of 32 Revisiting CM to Repair GCM, and Simeck
Intro Repairing GCM Simeck Design Summery Provable Security Reparing GCM
◮ addition, i.e. XOR
◮ not a permutation 17 of 32 Revisiting CM to Repair GCM, and Simeck
Intro Repairing GCM Simeck Design Summery Provable Security Reparing GCM
◮ addition, i.e. XOR
◮ not a permutation ◮ unless defined as next(N, r) = N ⊕ r, with r as another input 17 of 32 Revisiting CM to Repair GCM, and Simeck
Intro Repairing GCM Simeck Design Summery Provable Security Reparing GCM
◮ addition, i.e. XOR
◮ not a permutation ◮ unless defined as next(N, r) = N ⊕ r, with r as another input ◮ but f ⊕ r1 = g ⊕ r2
⇒ f ⊕ (r1 ⊟ r2) = g
◮ e.g., f ⊕ 2 = g ⊕ 1
⇒ f ⊕ (2 ⊟ 1) = f ⊕ 1 = g
17 of 32 Revisiting CM to Repair GCM, and Simeck
Intro Repairing GCM Simeck Design Summery Provable Security Reparing GCM
◮ addition, i.e. XOR
◮ not a permutation ◮ unless defined as next(N, r) = N ⊕ r, with r as another input ◮ but f ⊕ r1 = g ⊕ r2
⇒ f ⊕ (r1 ⊟ r2) = g
◮ e.g., f ⊕ 2 = g ⊕ 1
⇒ f ⊕ (2 ⊟ 1) = f ⊕ 1 = g
◮ multiplication, by a constant
◮ multiplying with a primitive element w 17 of 32 Revisiting CM to Repair GCM, and Simeck
Intro Repairing GCM Simeck Design Summery Provable Security Reparing GCM
◮ addition, i.e. XOR
◮ not a permutation ◮ unless defined as next(N, r) = N ⊕ r, with r as another input ◮ but f ⊕ r1 = g ⊕ r2
⇒ f ⊕ (r1 ⊟ r2) = g
◮ e.g., f ⊕ 2 = g ⊕ 1
⇒ f ⊕ (2 ⊟ 1) = f ⊕ 1 = g
◮ multiplication, by a constant
◮ multiplying with a primitive element w ◮ w r1f = w r2g =
⇒ w r1⊟r2f = g
17 of 32 Revisiting CM to Repair GCM, and Simeck
Intro Repairing GCM Simeck Design Summery Provable Security Reparing GCM
◮ addition, i.e. XOR
◮ not a permutation ◮ unless defined as next(N, r) = N ⊕ r, with r as another input ◮ but f ⊕ r1 = g ⊕ r2
⇒ f ⊕ (r1 ⊟ r2) = g
◮ e.g., f ⊕ 2 = g ⊕ 1
⇒ f ⊕ (2 ⊟ 1) = f ⊕ 1 = g
◮ multiplication, by a constant
◮ multiplying with a primitive element w ◮ w r1f = w r2g =
⇒ w r1⊟r2f = g
◮ cyclic permutation with two cycles ◮ {1, w, w 2, · · · , w 2n−2}, and {0} 17 of 32 Revisiting CM to Repair GCM, and Simeck
Intro Repairing GCM Simeck Design Summery Provable Security Reparing GCM
18 of 32 Revisiting CM to Repair GCM, and Simeck
Intro Repairing GCM Simeck Design Summery Provable Security Reparing GCM
◮ Lw(x) is full-cycle permutation
18 of 32 Revisiting CM to Repair GCM, and Simeck
Intro Repairing GCM Simeck Design Summery Provable Security Reparing GCM
◮ Lw(x) is full-cycle permutation ◮ Lr1 w(f (x)) = Lr2 w(g(x)) ⇔ Lr1⊟r2 w
18 of 32 Revisiting CM to Repair GCM, and Simeck
Intro Repairing GCM Simeck Design Summery Provable Security Reparing GCM
◮ Lw(x) is full-cycle permutation ◮ Lr1 w(f (x)) = Lr2 w(g(x)) ⇔ Lr1⊟r2 w
◮ Next, to investigate the number of solutions for
w(f (x)) = g(x)
18 of 32 Revisiting CM to Repair GCM, and Simeck
Intro Repairing GCM Simeck Design Summery Provable Security Reparing GCM
w(f (x)) = g(x)
1.1 If Lr
w(f (x)) = 0, then g(x) = 0.
19 of 32 Revisiting CM to Repair GCM, and Simeck
Intro Repairing GCM Simeck Design Summery Provable Security Reparing GCM
w(f (x)) = g(x)
1.1 If Lr
w(f (x)) = 0, then g(x) = 0.
1.2 If Lr
w(f (x)) = 0, then g(x) = w r−1.
19 of 32 Revisiting CM to Repair GCM, and Simeck
Intro Repairing GCM Simeck Design Summery Provable Security Reparing GCM
w(f (x)) = g(x)
1.1 If Lr
w(f (x)) = 0, then g(x) = 0.
1.2 If Lr
w(f (x)) = 0, then g(x) = w r−1.
2.1 If Lr
w(f (x)) = 0, then g(x) = 0.
19 of 32 Revisiting CM to Repair GCM, and Simeck
Intro Repairing GCM Simeck Design Summery Provable Security Reparing GCM
w(f (x)) = g(x)
1.1 If Lr
w(f (x)) = 0, then g(x) = 0.
1.2 If Lr
w(f (x)) = 0, then g(x) = w r−1.
2.1 If Lr
w(f (x)) = 0, then g(x) = 0.
2.2 If Lr
w(f (x)) = 0, let f (x) = w r1 and Lr w(f (x)) = w r2, where
0 ≤ r1, r2 < 2n − 1. Then we have
2.2.1 If r1 ≤ r2, then w rf (x) = g(x). 2.2.2 If r1 > r2, then w r−1f (x) = g(x).
19 of 32 Revisiting CM to Repair GCM, and Simeck
Intro Repairing GCM Simeck Design Summery Provable Security Reparing GCM
w(f (x)) = g(x)
1.1 If Lr
w(f (x)) = 0, then g(x) = 0.
1.2 If Lr
w(f (x)) = 0, then g(x) = w r−1.
2.1 If Lr
w(f (x)) = 0, then g(x) = 0.
2.2 If Lr
w(f (x)) = 0, let f (x) = w r1 and Lr w(f (x)) = w r2, where
0 ≤ r1, r2 < 2n − 1. Then we have
2.2.1 If r1 ≤ r2, then w rf (x) = g(x). 2.2.2 If r1 > r2, then w r−1f (x) = g(x).
19 of 32 Revisiting CM to Repair GCM, and Simeck
Intro Repairing GCM Simeck Design Summery Provable Security Reparing GCM
◮ Replacing counter ⊞ 1 by Lw
w(N0) ◮ The upper bound of counter collision will decrease
◮ from 222d to 22d
◮ Tighten the bounds of GCM by around 220 (1 million) times
◮ Both privacy and authenticity 20 of 32 Revisiting CM to Repair GCM, and Simeck
Intro Repairing GCM Simeck Design Summery Provable Security Reparing GCM
21 of 32 Revisiting CM to Repair GCM, and Simeck
Intro Repairing GCM Simeck Design Summery Design Rationales Specifications
22 of 32 Revisiting CM to Repair GCM, and Simeck
Intro Repairing GCM Simeck Design Summery Design Rationales Specifications
◮ LGCM + a lightweight block cipher
23 of 32 Revisiting CM to Repair GCM, and Simeck
Intro Repairing GCM Simeck Design Summery Design Rationales Specifications
◮ LGCM + a lightweight block cipher ◮ Specs of the block cipher in one tweet (140 chars) ◮ tweetcipher designed by Aumasson needs 6 tweets
23 of 32 Revisiting CM to Repair GCM, and Simeck
Intro Repairing GCM Simeck Design Summery Design Rationales Specifications 24 of 32 Revisiting CM to Repair GCM, and Simeck
Intro Repairing GCM Simeck Design Summery Design Rationales Specifications
◮ Consider the two block ciphers designed by Beaulieu et al.
◮ hardware-optimized cipher Simon ◮ software-optimized cipher Speck 25 of 32 Revisiting CM to Repair GCM, and Simeck
Intro Repairing GCM Simeck Design Summery Design Rationales Specifications
◮ Consider the two block ciphers designed by Beaulieu et al.
◮ hardware-optimized cipher Simon ◮ software-optimized cipher Speck
◮ Design comparisons
◮ Round function, both Feistel-like network
Simon Use AND for efficiency of hardware Speck ARX construction; decryption cannot reuse encryption functions
25 of 32 Revisiting CM to Repair GCM, and Simeck
Intro Repairing GCM Simeck Design Summery Design Rationales Specifications
◮ Consider the two block ciphers designed by Beaulieu et al.
◮ hardware-optimized cipher Simon ◮ software-optimized cipher Speck
◮ Design comparisons
◮ Round function, both Feistel-like network
Simon Use AND for efficiency of hardware Speck ARX construction; decryption cannot reuse encryption functions
◮ Key schedule
Simon Linear operations with constant sequences Speck Cleverly reuse round function
25 of 32 Revisiting CM to Repair GCM, and Simeck
Intro Repairing GCM Simeck Design Summery Design Rationales Specifications
◮ Consider the two block ciphers designed by Beaulieu et al.
◮ hardware-optimized cipher Simon ◮ software-optimized cipher Speck
◮ Design comparisons
◮ Round function, both Feistel-like network
Simon Use AND for efficiency of hardware Speck ARX construction; decryption cannot reuse encryption functions
◮ Key schedule
Simon Linear operations with constant sequences Speck Cleverly reuse round function
◮ How about we combine them two?
25 of 32 Revisiting CM to Repair GCM, and Simeck
Intro Repairing GCM Simeck Design Summery Design Rationales Specifications
◮ Combine the efficient designs
◮ Round function of Simon ◮ Key schedule of Speck
◮ Minimal design
◮ Keep the design as simple as possible ◮ If we could find attacks on the mini design ◮ Get attacks on Simon and/or Speck ◮ or understand more about Simon and Speck ◮ Get a fairly good authenticated cipher design
if no serious attack is found
26 of 32 Revisiting CM to Repair GCM, and Simeck
Intro Repairing GCM Simeck Design Summery Design Rationales Specifications
◮ Remove S1 ◮ Change S8 to S5, S2 to S1
The left image is from the Simon and Speck design paper. 27 of 32 Revisiting CM to Repair GCM, and Simeck
Intro Repairing GCM Simeck Design Summery Design Rationales Specifications
The image is from the Simon and Speck design paper. 28 of 32 Revisiting CM to Repair GCM, and Simeck
Intro Repairing GCM Simeck Design Summery Design Rationales Specifications
◮ 128-bit block cipher, compatible with LGCM ◮ 128/196/254 bits for master keys ◮ 32/48/64 rounds for security-levels
29 of 32 Revisiting CM to Repair GCM, and Simeck
Intro Repairing GCM Simeck Design Summery Design Rationales Specifications
◮ 128-bit block cipher, compatible with LGCM ◮ 128/196/254 bits for master keys ◮ 32/48/64 rounds for security-levels ◮ Hardware implementation
◮ Reuse the round function in key schedule ◮ Less bits of rotations ◮ Smaller footprint than hardware-optimized Simon 29 of 32 Revisiting CM to Repair GCM, and Simeck
Intro Repairing GCM Simeck Design Summery Design Rationales Specifications
◮ 128-bit block cipher, compatible with LGCM ◮ 128/196/254 bits for master keys ◮ 32/48/64 rounds for security-levels ◮ Hardware implementation
◮ Reuse the round function in key schedule ◮ Less bits of rotations ◮ Smaller footprint than hardware-optimized Simon
◮ Software implementation
◮ Comparable software performance with software-oriented Speck ◮ Decryption can reuse encryption round function ◮ Small code size (ROM) for software 29 of 32 Revisiting CM to Repair GCM, and Simeck
Intro Repairing GCM Simeck Design Summery Design Rationales Specifications
◮ 128-bit block cipher, compatible with LGCM ◮ 128/196/254 bits for master keys ◮ 32/48/64 rounds for security-levels ◮ Hardware implementation
◮ Reuse the round function in key schedule ◮ Less bits of rotations ◮ Smaller footprint than hardware-optimized Simon
◮ Software implementation
◮ Comparable software performance with software-oriented Speck ◮ Decryption can reuse encryption round function ◮ Small code size (ROM) for software
◮ Compact and clean specification (in one tweet!)
◮ Ideal for “lazy” programmers ◮ Neither Simon, nor Speck can fit into 140 chars 29 of 32 Revisiting CM to Repair GCM, and Simeck
Intro Repairing GCM Simeck Design Summery
30 of 32 Revisiting CM to Repair GCM, and Simeck
Intro Repairing GCM Simeck Design Summery
◮ Repairing GCM
◮ Merging two cycles by Lw ◮ Consider cyclic permutation polynomials? ◮ Redo proofs and recompute bounds with other fixes?
◮ Designing Simeck
◮ Ideas/designs from Simon and Speck ◮ To attack Simeck? ◮ More efficient mode of operation than GCM? 31 of 32 Revisiting CM to Repair GCM, and Simeck
Intro Repairing GCM Simeck Design Summery
32 of 32 Revisiting CM to Repair GCM, and Simeck