on recovering affine encodings in white box
play

On Recovering Affine Encodings in White-Box Implementations Patrick - PowerPoint PPT Presentation

On Recovering Affine Encodings in White-Box Implementations Patrick Derbez 1 , Pierre-Alain Fouque 1 , Baptiste Lambin 1 , Brice Minaud 2 1 Univ Rennes, CNRS, IRISA 2 Royal Holloway University of London Baptiste Lambin On Recovering Affine


  1. On Recovering Affine Encodings in White-Box Implementations Patrick Derbez 1 , Pierre-Alain Fouque 1 , Baptiste Lambin 1 , Brice Minaud 2 1 Univ Rennes, CNRS, IRISA 2 Royal Holloway University of London Baptiste Lambin On Recovering Affine Encodings in White-Box Implementations 1 / 21

  2. Introduction 1 Generic algorithm 2 Dedicated attack on Baek et al.’s scheme 3 Baptiste Lambin On Recovering Affine Encodings in White-Box Implementations 2 / 21

  3. Introduction Introduction 1 Generic algorithm 2 Dedicated attack on Baek et al.’s scheme 3 Baptiste Lambin On Recovering Affine Encodings in White-Box Implementations 3 / 21

  4. Introduction Black box vs. White box Gray box model Black box model White box model in in in key = 0x1337. . . key schedule(key) AES K AES K out = in for i in 0. . .10 round i(out,key) return out out out out leakage Baptiste Lambin On Recovering Affine Encodings in White-Box Implementations 4 / 21

  5. Introduction White box implementation Attacker: • extracting key information from the implementation in • computing decryption scheme from encryption scheme key = 0x1337. . . key schedule(key) Designer: out = in • provide sound and secure imple- for i in 0. . .10 mentation round i(out,key) return out Main application: • Digital Rights Management out • Fast (post-quantum ) public-key encryption scheme Baptiste Lambin On Recovering Affine Encodings in White-Box Implementations 5 / 21

  6. Introduction Two main design strategies Table lookup First proposal by Chow et al. in 2002: broken Xiao and Lai in 2009: broken Karroumi et al. in 2011: broken Baek et al. in 2016: our target WhiteBlock from Fouque et al. : secure (but weird model) ASASA-like designs SASAS construction: broken in 2001 by Biryukov and Shamir ASASA proposals (Biryukov et al. , 2014): broken Recent proposals at ToSC’17 by Biryukov et al. to use more layers, leading to SA. . . SAS Baptiste Lambin On Recovering Affine Encodings in White-Box Implementations 6 / 21

  7. Introduction CEJO Framework Derived from Chow et al. first white-box candidate constructions. Block cipher decomposed into R round functions. Round functions obfuscated using encodings. Obfuscated round functions implemented and evaluated using several tables (of reasonable size) · · · ◦ f ( r +1) − 1 ◦ E ( r ) ◦ f ( r ) ◦ f ( r ) − 1 ◦ E ( r − 1) ◦ f ( r − 1) ◦ . . . � �� � � �� � table table Increase security with external encodings The affine and non-linear part of all f ( r ) is often structured for efficient implementations ! Baptiste Lambin On Recovering Affine Encodings in White-Box Implementations 7 / 21

  8. Introduction Affine Equivalence Algorithm In 2003, Biryukov, De Canni` ere, Braeken and Preneel proposed an algorithm to solve the following problem: Given two bijections S 1 and S 2 on n bits, find affine mappings A and B such that S 2 = B ◦ S 1 ◦ A , if they exist. Ascertain whether such mappings exist Enumerate all solutions � n 3 2 2 n � � n 3 2 n � Time complexity in O , O if A , B linears � n 3 2 n � Improved by Dinur at Eurocrypt’18 to O in the affine case, but with a few limitations Baptiste Lambin On Recovering Affine Encodings in White-Box Implementations 8 / 21

  9. Generic algorithm Introduction 1 Generic algorithm 2 Dedicated attack on Baek et al.’s scheme 3 Baptiste Lambin On Recovering Affine Encodings in White-Box Implementations 9 / 21

  10. Generic algorithm Problem to solve for the attacker non-linear affine affine   S 1 .   without knowing F − 1 . Given = ◦ ◦ F B A . S k known secret secret known F − 1 is easily Find an equivalent representation ˜ F of F such that ˜ computable (leads to a decryption function). Find which A and B were used (leads to a key recovery). Baptiste Lambin On Recovering Affine Encodings in White-Box Implementations 10 / 21

  11. Generic algorithm Overview of the algorithm 2-step algorithm: 1 Isolate the input and output subspaces of each Sbox (essentially the technique from Biryukov and Shamir in their SASAS cryptanalysis) 2 Apply the generic affine equivalence algorithm to each Sbox separately Baptiste Lambin On Recovering Affine Encodings in White-Box Implementations 11 / 21

  12. Generic algorithm Finding input subspace of each S-box V 1 U 1 n m n ⋆ S 1 ⋆ 0 0 * S 2 * ⋆ ⋆ * S 3 * ⋆ ⋆ B A * S k * ⋆ ⋆ dim dim n − m n − m Baptiste Lambin On Recovering Affine Encodings in White-Box Implementations 12 / 21

  13. Generic algorithm Building V 1 Testing if ∆ ∈ V 1 : X = { x i ∈ F n 2 , x i random } ”big enough” U = { F ( x i ) ⊕ F ( x i ⊕ ∆) , x i ∈ X } (output difference space) If dim(Span( U )) = n − m , then ∆ ∈ V 1 w.h.p. Build a basis of V 1 by doing the same test on independent vectors, and by testing if the resulting output difference space is the same. Do this k times to build all V 1 , . . . , V k . Baptiste Lambin On Recovering Affine Encodings in White-Box Implementations 13 / 21

  14. Generic algorithm Finding input subspace of each S-box � O 1 V i = I 1 i � =1 ⋆ * S 1 * ⋆ S 2 0 0 ⋆ ⋆ S 3 0 0 ⋆ ⋆ B A S k 0 0 ⋆ ⋆ dim dim m m Baptiste Lambin On Recovering Affine Encodings in White-Box Implementations 14 / 21

  15. Generic algorithm Recovering affine layers   S 1 .  ◦ A  . B ◦ . S k Q i P i F m F m O i I i 2 2 dim dim m m Apply the Affine Equivalence Algorithm on each F i = Q i ◦ F ◦ P i Lead to 2 affine mappings A i , B i such that F i = B i ◦ S i ◦ A i Build A ′ from all A i ’s and P i ’s, B ′ from all B i ’s and Q i ’s such that B ′ ◦ ( S 1 , . . . , S k ) ◦ A ′ = F � � We can now inverse F easily as F − 1 = A ′ − 1 ◦ ′ − 1 ! S − 1 1 , . . . , S − 1 ◦ B k Baptiste Lambin On Recovering Affine Encodings in White-Box Implementations 15 / 21

  16. Generic algorithm Complexities Complexity of solving the problem: Biryukov et al. : O ( n 3 2 2 n ), Dinur : O ( n 3 2 n ) � � min( n m +4 2 2 m / m , n log( n )2 n / 2 ) Baek et al. : O � � 2 m n 3 + n 4 m + 2 m m 2 n Our (best case): O � m + 2 m mn 2 � 2 m n 3 + n 4 Our (different Sboxes): O � � 2 m n 3 + n 4 m + 2 2 m m 2 n Our (worst case, e.g. AES S-box): O Applications: 128-bit block cipher, AES S-box (8 bits) : ∼ 2 30 operations Baek et al. proposal (256-bit block, AES S-box) : ∼ 2 35 operations Baptiste Lambin On Recovering Affine Encodings in White-Box Implementations 16 / 21

  17. Dedicated attack on Baek et al.’s scheme Introduction 1 Generic algorithm 2 Dedicated attack on Baek et al.’s scheme 3 Baptiste Lambin On Recovering Affine Encodings in White-Box Implementations 17 / 21

  18. Dedicated attack on Baek et al.’s scheme The Baek, Cheon and Hong proposal Round function of AES : AES ( r ) = MC ◦ SR ◦ SB ◦ ARK 256-bit 256-bit A ( r ) A ( r ) K ( r ) K ( r ) ⇒ AES ( r ) AES ( r ) S . . . S S . . . S table � A ( r +1) � − 1 MC ◦ SR MC ◦ SR M ( r ) � A ( r +1) � − 1 256-bit 256-bit Security claim : 110 bits Baptiste Lambin On Recovering Affine Encodings in White-Box Implementations 18 / 21

  19. Dedicated attack on Baek et al.’s scheme Overview of the attack � ∗ ∗ � ∗ ∗ ... From encoded round functions F ≃ B ◦ S ◦ A with A ≃ ∗ ∗ 1 Reduce the problem to block diagonal encodings : F = B ◦ S ◦ A ′ with A ′ block diagonal. ⇒ � 2 Compute candidates for each block: Using a projection, P ◦ B ◦ S ◦ A ′ i is affine equivalent to S . 1 Use the affine equivalence algorithm from [BCBP03] to get some 2 candidates for A ′ i . 3 Identify the correct blocks : Use a MITM technique to filter the wrong candidates See our paper for more details ! Baptiste Lambin On Recovering Affine Encodings in White-Box Implementations 19 / 21

  20. Dedicated attack on Baek et al.’s scheme Implementation ( Intel Core i7-6600U CPU @ 2.60GHz ): ∼ 2000 C++ code lines Main cost : 64 calls to the affine equivalence algorithm ( ∼ 64 × 2 25 ) Generic algorithm complexity : ∼ 2 35 (Decryption function) Dedicated attack complexity : ∼ 2 31 (Key-recovery) Total time : ∼ 12s, negligible memory Implementation available at http://wbcheon.gforge.inria.fr/ . Fixing the construction for 60-bit security would require n = 2 13 parallel AES, leading to an implementation of size ∼ 2 12 TB Baptiste Lambin On Recovering Affine Encodings in White-Box Implementations 20 / 21

  21. Dedicated attack on Baek et al.’s scheme Conclusion Given F = B ◦ ( S 1 , . . . , S k ) ◦ A , with A and B secret, we provide a generic algorithm to efficiently compute F − 1 . This efficiently solve a critical step when attacking table-based white box implementations. � � 2 m n 3 + n 4 m + 2 m m 2 n Best case complexity : O In practice with AES parameters : ∼ 2 30 Scale linearly if S-boxes are different We mounted a dedicated attack on Baek et al. ’s scheme, leading to a key recovery in about 2 31 operations. Baptiste Lambin On Recovering Affine Encodings in White-Box Implementations 21 / 21

Recommend


More recommend