Symmetric Key Cryptography Introduction to Symmetric Key - - PowerPoint PPT Presentation

symmetric key cryptography introduction to symmetric key
SMART_READER_LITE
LIVE PREVIEW

Symmetric Key Cryptography Introduction to Symmetric Key - - PowerPoint PPT Presentation

PQCRYPTO Summer School on Post-Quantum Cryptography 2017 Stefan Klbl June 20th, 2017 DTU Compute, Technical University of Denmark Symmetric Key Cryptography Introduction to Symmetric Key Cryptography What can we do? Authentication


slide-1
SLIDE 1

Symmetric Key Cryptography

PQCRYPTO Summer School on Post-Quantum Cryptography 2017

Stefan Kölbl June 20th, 2017

DTU Compute, Technical University of Denmark

slide-2
SLIDE 2

Introduction to Symmetric Key Cryptography

slide-3
SLIDE 3

Symmetric Key Cryptography

What can we do?

  • Encryption
  • Authentication (MAC)
  • Hashing
  • Random Number Generation
  • Digital Signature Schemes
  • Key Exchange

1

slide-4
SLIDE 4

Authentication

slide-5
SLIDE 5

Authentication

Message Authentication Code (MAC) Message Tag MAC Key

  • Produces a tag
  • Provide both authenticity and integrity
  • It should be hard to forge a valid tag.
  • Similar to hash but has a key
  • Similar to digital signature but same key

2

slide-6
SLIDE 6

Authentication

MAC Algorithm

  • Block Cipher Based (CBC-MAC)
  • Hash-based (HMAC, Sponge)
  • Universal Hashing (UMAC, Poly1305)

3

slide-7
SLIDE 7

Authentication

CBC-MAC M1 EK M2 EK Mi T EK

4

slide-8
SLIDE 8

Authentication

Hash-based:

  • H(k || m)
  • Okay with Sponge, fails with MD construction.
  • H(m || k)
  • Collision on H allows to construct Tag collision.
  • HMAC: H(k ⊕ c1∥| H(k ⊕ c2||m))

5

slide-9
SLIDE 9

Authentication

Universal Hashing (UMAC, Poly1305, …)

  • We need a universal hash function family H.
  • Parties share a secret member of H and key k.
  • Attacker does not know which one was chosen.

Definition A set H of hash functions h : U → N is universal iff ∀x, y ∈ U: Pr

h∈H(h(x) = h(y)) ≤

1 |N| when h is chosen uniformly at random.

6

slide-10
SLIDE 10

Authenticated Encryption

In practice we always want Authenticated Encryption

  • Encryption does not protect against malicious alterations.
  • WEP [TWP07]
  • Plaintext recovery OpenSSH [APW09]
  • Recover TLS cookies [DR11]

Problem Lot of things can go wrong when combining encryption and authentication. Note: This can allow to recover plaintext, forge messages...

7

slide-11
SLIDE 11

Authenticated Encryption [BN00]

Encrypt-and-MAC Message Ciphertext Tag MACK′ EK

8

slide-12
SLIDE 12

Authenticated Encryption [BN00]

MAC-then-Encrypt Message Message Ciphertext Tag MACK′ EK

9

slide-13
SLIDE 13

Authenticated Encryption [BN00]

Encrypt-then-MAC Message EK Ciphertext Ciphertext MACK′ Tag

10

slide-14
SLIDE 14

Authenticated Encryption

You have to be careful! CTR-Mode

N || 1 EK M1 C1 N || 2 EK M2 C2 N || 3 EK M3 C3

CBC-MAC

M1 EK M2 EK Mi T EK

11

slide-15
SLIDE 15

Authenticated Encryption

Authenticated Encryption with Associated Data (AEAD) A1, . . . , Am M1, . . . , Ml N

AE

C1, . . . , Cm T

  • Associcated Data A (e.g. packet header)
  • Nonce N (unique number)

12

slide-16
SLIDE 16

Authenticated Encryption

Galois/Counter Mode (GCM)

N||1 EK M1 C1 N||2 EK M2 C2 … N||l EK Ml Cl A1, . . . , Am m || l T EK H N||0 EK ×H ×H ×H ×H ×H

13

slide-17
SLIDE 17

Authenticated Encryption

Galois/Counter Mode (GCM)

N||1 EK M1 C1 N||2 EK M2 C2 … N||l EK Ml Cl A1 Am m l T

K

H N 0

K

H H H H H

13

slide-18
SLIDE 18

Authenticated Encryption

Galois/Counter Mode (GCM)

N||1 EK M1 C1 N||2 EK M2 C2 … N||l EK Ml Cl A1, . . . , Am m || l T EK H N||0 EK ×H ×H ×H ×H ×H

13

slide-19
SLIDE 19

Authenticated Encryption

AES-GCM

  • Widely used (TLS)
  • Reusing nonce compromises security
  • Weak keys for ×H
  • Hardware support for AES + PCLMULQDQ
  • AES-GCM-SIV?

14

slide-20
SLIDE 20

Authenticated Encryption

CAESAR1: Competition for Authenticated Encryption: Security, Applicability, and Robustness

  • Initially 57 submissions.
  • Third round: 15 Submissions left
  • Goal is to have a portfolio of AE schemes

Summary Most applications need Authenticated Encryption!

1https://competitions.cr.yp.to/caesar.html

15

slide-21
SLIDE 21

Quantum Attacks

slide-22
SLIDE 22

Quantum Attacks

Attack Model

  • Attacker listens to communication over classical channel.
  • Can query a classic blackbox with the secret key.
  • Attacker has large quantum computer.
  • Only limited set of quantum algorithms available.

16

slide-23
SLIDE 23

Quantum Attacks

Encryption / MACs

  • Recover Key in O(2k/2) with Grover’s.

Hash Function

  • Find Preimage in O(2n/2) with Grover’s.
  • Find Collisions in O(2n/3) [BHT97] ... but needs O(2n/3) hardware.

17

slide-24
SLIDE 24

Quantum Attacks

The costs are not so simple

  • Costs of quantum operation vs. classic operations
  • Collision finding not really faster [Ber09].

There is some work on better understanding this:

  • Preimage SHA-256: 2166 logical-qubit-cycles [Amy+16].
  • Preimage SHA3-256: 2166 logical-qubit-cycles [Amy+16].

18

slide-25
SLIDE 25

Quantum Attacks

Even-Mansour

  • Two keys k1, k2.
  • Uses public permutation π.

π p c k1 k2 Classic Security

  • D queries to E
  • T queries to π
  • Proof for upper bound on attack success O(DT/2n)

19

slide-26
SLIDE 26

Quantum Attacks

Quantum Oracle Access to encryption algorithm |x⟩ |0⟩ |x⟩ |EK(x)⟩ EK

  • Very strong model for adversary.

20

slide-27
SLIDE 27

Quantum Attacks

Simon’s Algorithm Given f : {0, 1}n → {0, 1}n with promise that there exists s ∈ {0, 1}n such that ∀(x, y) ∈ {0, 1}n : f(x) = f(y) ⇐ ⇒ x ⊕ y ∈ {0n, s} Output: s Only needs O(n) quantum queries.

21

slide-28
SLIDE 28

Simon’s Algorithm

Circuit |0⟩ |0⟩ f(z) v H⊗n f H⊗n |0n⟩|0n⟩ Result One steps finds a vector such that y s 0.

22

slide-29
SLIDE 29

Simon’s Algorithm

Circuit |0⟩ |0⟩ f(z) v H⊗n f H⊗n 1 √ 2n ∑

x

|x⟩|0n⟩ Result One steps finds a vector such that y s 0.

22

slide-30
SLIDE 30

Simon’s Algorithm

Circuit |0⟩ |0⟩ f(z) v H⊗n f H⊗n 1 √ 2n ∑

x

|x⟩|f(x)⟩ Result One steps finds a vector such that y s 0.

22

slide-31
SLIDE 31

Simon’s Algorithm

Circuit |0⟩ |0⟩ f(z) v H⊗n f H⊗n 1 √ 2 |z⟩ + 1 √ 2 |z ⊕ s⟩ Result One steps finds a vector such that y s 0.

22

slide-32
SLIDE 32

Simon’s Algorithm

Circuit |0⟩ |0⟩ f(z) v H⊗n f H⊗n 1 √ 2 1 √ 2n ∑

y

(−1)y·z(1 + (−1)y·s)|y⟩ Result One steps finds a vector such that y s 0.

22

slide-33
SLIDE 33

Simon’s Algorithm

Circuit |0⟩ |0⟩ f(z) v H⊗n f H⊗n 1 √ 2 1 √ 2n ∑

y

(−1)y·z(1 + (−1)y·s)|y⟩ Result One steps finds a vector such that y · s = 0.

22

slide-34
SLIDE 34

Quantum

Breaking Even-Mansour [KM12] Ek1,k2(x) = π(x ⊕ k1) ⊕ k2 Construct: f : {0, 1}n → {0, 1}n x → Ek1,k2(x) ⊕ π(x) = π(x ⊕ k1) ⊕ k2 ⊕ π(x) This function fulfills Simon’s promise: f(x) = π(x ⊕ k1) ⊕ k2 ⊕ π(x) f(x ⊕ k1) = π(x ⊕ k1 ⊕ k1) ⊕ k2 ⊕ π(x ⊕ k1) Recover k1 with O n quantum queries.

23

slide-35
SLIDE 35

Quantum

Breaking Even-Mansour [KM12] Ek1,k2(x) = π(x ⊕ k1) ⊕ k2 Construct: f : {0, 1}n → {0, 1}n x → Ek1,k2(x) ⊕ π(x) = π(x ⊕ k1) ⊕ k2 ⊕ π(x) This function fulfills Simon’s promise: f(x) = π(x ⊕ k1) ⊕ k2 ⊕ π(x) f(x ⊕ k1) = π(x) ⊕ k2 ⊕ π(x ⊕ k1) Recover k1 with O n quantum queries.

23

slide-36
SLIDE 36

Quantum

Breaking Even-Mansour [KM12] Ek1,k2(x) = π(x ⊕ k1) ⊕ k2 Construct: f : {0, 1}n → {0, 1}n x → Ek1,k2(x) ⊕ π(x) = π(x ⊕ k1) ⊕ k2 ⊕ π(x) This function fulfills Simon’s promise: f(x) = π(x ⊕ k1) ⊕ k2 ⊕ π(x) f(x ⊕ k1) = π(x ⊕ k1) ⊕ k2 ⊕ π(x) Recover k1 with O(n) quantum queries.

23

slide-37
SLIDE 37

Quantum Attacks

Similar attacks [Kap+16] apply to

  • Block Cipher Modes
  • MACs
  • Authenticated Encryption
  • Improving Slide Attacks

Goal Construct f such that f x f x s for some secret s.

24

slide-38
SLIDE 38

Quantum Attacks

Similar attacks [Kap+16] apply to

  • Block Cipher Modes
  • MACs
  • Authenticated Encryption
  • Improving Slide Attacks

Goal Construct f such that f(x) = f(x ⊕ s) for some secret s.

24

slide-39
SLIDE 39

Current Directions in Symmetric Key Cryptography

slide-40
SLIDE 40

Symmetric Key Cryptography

Lightweight Cryptography

  • Resource constraint
  • Chip area
  • Memory
  • Computing Power
  • Power/Energy
  • NIST Project5
  • Many designs exists

Server Laptop / Desktop Smartphones Smart devices Microcontrollers FPGA ASIC RFID / Sensor Networks

Computing Power Lightweight Standard

1https://beta.csrc.nist.gov/projects/lightweight-cryptography

25

slide-41
SLIDE 41

Symmetric Key Cryptography

Hash-based Signatures:

  • Many calls to a hash

function...

  • ...but only very short inputs.
  • No collision resistance

required Current Designs:

  • Often slow on short inputs.
  • Too conservative for this

restricted setting?

  • Designs: ChaCha in

SPHINCS, Haraka [Köl+] f f f

26

slide-42
SLIDE 42

Symmetric Key Cryptography

Multiparty Computation, Zero Knowledge, Fully Homomorphic Encryption

  • Multiplications in primitives very costly for these applications.
  • Signature size directly relates to number of ANDs (for ZK).

Symmetric Key Primitives which:

  • Minimize number of ANDs
  • Minimize circuit depth
  • Examples: LowMC [Alb+15], MiMC [Alb+16], Kreyvium [Can+16],

Flip [Méa+16]

27

slide-43
SLIDE 43

Conclusion

Symmetric Key Cryptography

  • Encryption: AES-CTR
  • Hash: SHA-2, SHA-3
  • Authenticated Encryption: AES-GCM, ChaCha20-Poly1305, CAESAR

Quantum Attacks

  • Mostly fine with double the parameter sizes.
  • Improve cryptanalytic attacks with quantum algorithms.

1Thanks to https://www.iacr.org/authors/tikz/ for some of the figures.

28

slide-44
SLIDE 44

Questions?

28

slide-45
SLIDE 45

References i

Martin R. Albrecht, Kenneth G. Paterson, and Gaven J. Watson. “Plaintext Recovery Attacks against SSH”. In: 30th IEEE Symposium on Security and Privacy (S&P 2009). 2009, pp. 16–26. Martin R. Albrecht et al. “Ciphers for MPC and FHE”. In: Advances in Cryptology - EUROCRYPT 2015. 2015, pp. 430–454. Martin R. Albrecht et al. “MiMC: Efficient Encryption and Cryptographic Hashing with Minimal Multiplicative Complexity”. In: Advances in Cryptology - ASIACRYPT 2016. 2016, pp. 191–219. Matthew Amy et al. Estimating the cost of generic quantum pre-image attacks on SHA-2 and SHA-3. Cryptology ePrint Archive, Report 2016/992. http://eprint.iacr.org/2016/992. 2016. Gilles Brassard, Peter Høyer, and Alain Tapp. “Quantum cryptanalysis of hash and claw-free functions”. In: SIGACT News 28.2 (1997), pp. 14–19.

29

slide-46
SLIDE 46

References ii

Mihir Bellare and Chanathip Namprempre. “Authenticated Encryption: Relations among Notions and Analysis of the Generic Composition Paradigm”. In: Advances in Cryptology - ASIACRYPT 2000. 2000, pp. 531–545. Daniel J Bernstein. “Cost analysis of hash collisions: Will quantum computers make SHARCS obsolete?”. In: SHARCS’09 Special-purpose Hardware for Attacking Cryptographic Systems (2009), p. 105. Anne Canteaut et al. “Stream Ciphers: A Practical Solution for Efficient Homomorphic-Ciphertext Compression”. In: Fast Software Encryption - 23rd International Conference, FSE 2016. 2016, pp. 313–333. Thai Duong and Juliano Rizzo. “Cryptography in the Web: The Case of Cryptographic Design Flaws in ASP.NET”. In: 32nd IEEE Symposium on Security and Privacy, S&P 2011. 2011, pp. 481–489. Hidenori Kuwakado and Masakatu Morii. “Security on the quantum-type Even-Mansour cipher”. In: Proceedings of the International Symposium on Information Theory and its Applications, ISITA 2012. 2012, pp. 312–316.

30

slide-47
SLIDE 47

References iii

Marc Kaplan et al. “Breaking Symmetric Cryptosystems Using Quantum Period Finding”. In: Advances in Cryptology - CRYPTO 2016. 2016,

  • pp. 207–237.

Stefan Kölbl et al. “Haraka v2 - Efficient Short-Input Hashing for Post-Quantum Applications”. In: IACR Trans. Symmetric Cryptol. 2016 (). Pierrick Méaux et al. “Towards Stream Ciphers for Efficient FHE with Low-Noise Ciphertexts”. In: Advances in Cryptology - EUROCRYPT 2016. 2016, pp. 311–343. Erik Tews, Ralf-Philipp Weinmann, and Andrei Pyshkin. Breaking 104 bit WEP in less than 60 seconds. Cryptology ePrint Archive, Report 2007/120. http://eprint.iacr.org/2007/120. 2007.

31