implementing practical leakage resilient symmetric
play

Implementing Practical leakage-resilient symmetric cryptography - PDF document

Implementing Practical leakage-resilient symmetric cryptography Daniel J. Bernstein University of Illinois at Chicago, Technische Universiteit Eindhoven CHES 2012 paper Practical leakage-resilient symmetric cryptography (Faust,


  1. Implementing “Practical leakage-resilient symmetric cryptography” Daniel J. Bernstein University of Illinois at Chicago, Technische Universiteit Eindhoven

  2. CHES 2012 paper “Practical leakage-resilient symmetric cryptography” (Faust, Pietrzak, Schipper) explains how to “protect against realistic side-channel attacks.”

  3. CHES 2012 paper “Practical leakage-resilient symmetric cryptography” (Faust, Pietrzak, Schipper) explains how to “protect against realistic side-channel attacks.” Sounds great! But is it secure?

  4. CHES 2012 paper “Practical leakage-resilient symmetric cryptography” (Faust, Pietrzak, Schipper) explains how to “protect against realistic side-channel attacks.” Sounds great! But is it secure? Will an implementor doing what this paper says actually end up with a side-channel-protected cipher?

  5. The TCC view: “What do you mean? It’s provably secure! We have proofs and theorems!”

  6. The TCC view: “What do you mean? It’s provably secure! We have proofs and theorems!” Macbeth’s view: “It is a tale told by an idiot, full of sound and fury, signifying nothing.”

  7. The TCC view: “What do you mean? It’s provably secure! We have proofs and theorems!” Macbeth’s view: “It is a tale told by an idiot, full of sound and fury, signifying nothing.” My view: Carefully evaluating side-channel security requires an implementation. ✮ Let’s implement the cipher.

  8. Prerequisite: “ ❋ ”, a “PRF” (or a “weak PRF”) mapping a ❦ -bit key and an ❵ -bit nonce to a 2 ❦ -bit output.

  9. Prerequisite: “ ❋ ”, a “PRF” (or a “weak PRF”) mapping a ❦ -bit key and an ❵ -bit nonce to a 2 ❦ -bit output. Hmmm, this is vague. What’s ❦ ? ❵ ? ❋ ? Practical cryptography requires complete specification.

  10. Prerequisite: “ ❋ ”, a “PRF” (or a “weak PRF”) mapping a ❦ -bit key and an ❵ -bit nonce to a 2 ❦ -bit output. Hmmm, this is vague. What’s ❦ ? ❵ ? ❋ ? Practical cryptography requires complete specification. My best guesses: ❦ = 128; ❵ = 127; ❋ ❑ ( ♣ ) = AES ❑ (0 ♣ ) AES ❑ (1 ♣ ).

  11. First-level cipher Γ: Input: 128-bit key ❑ ; standard random 32639-bit string ♣ = ( ♣ 0 ❀ ♣ 1 ❀ ✿ ✿ ✿ ❀ ♣ 255 ❀ ♣ 256 ); 256-bit nonce ♥ = ( ♥ 0 ❀ ♥ 1 ❀ ✿ ✿ ✿ ❀ ♥ 255 ).

  12. First-level cipher Γ: Input: 128-bit key ❑ ; standard random 32639-bit string ♣ = ( ♣ 0 ❀ ♣ 1 ❀ ✿ ✿ ✿ ❀ ♣ 255 ❀ ♣ 256 ); 256-bit nonce ♥ = ( ♥ 0 ❀ ♥ 1 ❀ ✿ ✿ ✿ ❀ ♥ 255 ). Compute ❳ 0 = ❑ , ❳ 1 = AES ❳ 0 ( ♥ 0 ♣ 0 ), ❳ 2 = AES ❳ 1 ( ♥ 1 ♣ 1 ), ✿ ✿ ✿ , ❳ 256 = AES ❳ 255 ( ♥ 255 ♣ 255 ).

  13. First-level cipher Γ: Input: 128-bit key ❑ ; standard random 32639-bit string ♣ = ( ♣ 0 ❀ ♣ 1 ❀ ✿ ✿ ✿ ❀ ♣ 255 ❀ ♣ 256 ); 256-bit nonce ♥ = ( ♥ 0 ❀ ♥ 1 ❀ ✿ ✿ ✿ ❀ ♥ 255 ). Compute ❳ 0 = ❑ , ❳ 1 = AES ❳ 0 ( ♥ 0 ♣ 0 ), ❳ 2 = AES ❳ 1 ( ♥ 1 ♣ 1 ), ✿ ✿ ✿ , ❳ 256 = AES ❳ 255 ( ♥ 255 ♣ 255 ). Output: 256-bit string AES ❳ 256 ( ♣ 256 0) AES ❳ 256 ( ♣ 256 1).

  14. The final cipher: Input: 384-bit key ❑ 0 ❀ ❑ 1 ❀ ❑ 2 ; 512-bit plaintext ( ❛ 0 ❀ ❜ 0 ).

  15. The final cipher: Input: 384-bit key ❑ 0 ❀ ❑ 1 ❀ ❑ 2 ; 512-bit plaintext ( ❛ 0 ❀ ❜ 0 ). Compute ( ❛ 1 ❀ ❜ 1 ) = ( ❛ 0 ❀ ❜ 0 ✟ Γ ❑ 0 ( ❛ 0 )); ( ❛ 2 ❀ ❜ 2 ) = ( ❛ 1 ✟ Γ ❑ 1 ( ❜ 1 ) ❀ ❜ 1 ); ( ❛ 3 ❀ ❜ 3 ) = ( ❛ 2 ❀ ❜ 2 ✟ Γ ❑ 2 ( ❛ 2 )).

  16. The final cipher: Input: 384-bit key ❑ 0 ❀ ❑ 1 ❀ ❑ 2 ; 512-bit plaintext ( ❛ 0 ❀ ❜ 0 ). Compute ( ❛ 1 ❀ ❜ 1 ) = ( ❛ 0 ❀ ❜ 0 ✟ Γ ❑ 0 ( ❛ 0 )); ( ❛ 2 ❀ ❜ 2 ) = ( ❛ 1 ✟ Γ ❑ 1 ( ❜ 1 ) ❀ ❜ 1 ); ( ❛ 3 ❀ ❜ 3 ) = ( ❛ 2 ❀ ❜ 2 ✟ Γ ❑ 2 ( ❛ 2 )). Output: 512-bit ciphertext ( ❛ 3 ❀ ❜ 3 ).

  17. I implemented this cipher during a talk this morning.

  18. I implemented this cipher during a talk this morning. “Code simplicity?”

  19. I implemented this cipher during a talk this morning. “Code simplicity?” Not bad, assuming AES is provided. I used AES from OpenSSL.

  20. I implemented this cipher during a talk this morning. “Code simplicity?” Not bad, assuming AES is provided. I used AES from OpenSSL. “Validation status?”

  21. I implemented this cipher during a talk this morning. “Code simplicity?” Not bad, assuming AES is provided. I used AES from OpenSSL. “Validation status?” Bad. Surely there are bugs. Practical cryptography requires test vectors.

  22. I implemented this cipher during a talk this morning. “Code simplicity?” Not bad, assuming AES is provided. I used AES from OpenSSL. “Validation status?” Bad. Surely there are bugs. Practical cryptography requires test vectors. “Source of random ♣ ?”

  23. I implemented this cipher during a talk this morning. “Code simplicity?” Not bad, assuming AES is provided. I used AES from OpenSSL. “Validation status?” Bad. Surely there are bugs. Practical cryptography requires test vectors. “Source of random ♣ ?” Bad. I used C’s random() .

  24. I implemented this cipher during a talk this morning. “Code simplicity?” Not bad, assuming AES is provided. I used AES from OpenSSL. “Validation status?” Bad. Surely there are bugs. Practical cryptography requires test vectors. “Source of random ♣ ?” Bad. I used C’s random() . I’m going to hell.

  25. “Code availability?”

  26. “Code availability?” Good. cr.yp.to/aesgonewild.html

  27. “Code availability?” Good. cr.yp.to/aesgonewild.html “Speed?”

  28. “Code availability?” Good. cr.yp.to/aesgonewild.html “Speed?” Horrifying. Encrypting 64 bytes: close to 1 million cycles on one core of my laptop.

  29. “Code availability?” Good. cr.yp.to/aesgonewild.html “Speed?” Horrifying. Encrypting 64 bytes: close to 1 million cycles on one core of my laptop. But faster than FHE .

  30. “Code availability?” Good. cr.yp.to/aesgonewild.html “Speed?” Horrifying. Encrypting 64 bytes: close to 1 million cycles on one core of my laptop. But faster than FHE . “Security?” Unclear! Try hyperthreading, DPA, etc. Maybe chosen- ♥ templates will discover secret ♥ ? Don’t let slow ciphers evade security evaluation.

Recommend


More recommend