A High-Level Overview of Cryptography Daniel Bosk School of - - PowerPoint PPT Presentation

a high level overview of cryptography
SMART_READER_LITE
LIVE PREVIEW

A High-Level Overview of Cryptography Daniel Bosk School of - - PowerPoint PPT Presentation

Introduction Shared-key cryptography Public-key cryptography More counter-intuitive things References A High-Level Overview of Cryptography Daniel Bosk School of Computer Science and Communication, KTH Royal Institute of Technology,


slide-1
SLIDE 1

Introduction Shared-key cryptography Public-key cryptography More counter-intuitive things References

A High-Level Overview of Cryptography

Daniel Bosk

School of Computer Science and Communication, KTH Royal Institute of Technology, Stockholm Department of Information and Communication Systems, Mid Sweden University, Sundsvall

13th March 2019

Daniel Bosk KTH/MIUN A High-Level Overview of Cryptography 1

slide-2
SLIDE 2

Introduction Shared-key cryptography Public-key cryptography More counter-intuitive things References

1 Introduction

History Kerckhoff’s Principle Outline

2 Shared-key cryptography

Ciphers Security Hash functions Message-authentication codes

3 Public-key cryptography

Key-exchange schemes Encryption and decryption Digital signatures Homomorphic properties

4 More counter-intuitive things

Secure multi-party computation Zero-knowledge proofs of knowledge

Daniel Bosk KTH/MIUN A High-Level Overview of Cryptography 2

slide-3
SLIDE 3

Introduction Shared-key cryptography Public-key cryptography More counter-intuitive things References History

The word has its origin in greek1: κρυπτς (kryptos) meaning hidden2. γρφος (graphos) meaning writing3. The area has been around for ages. We should not confuse it with steganography. Steganography concerns hiding a message’s existence. Cryptography concerns hiding a message’s contents.

1‘cryptography, n.’. In: OED Online. Hämtad den 5 april 2013. Oxford

University Press, Mar. 2013. URL: http://www.oed.com/view/Entry/45374?redirectedFrom=cryptography&.

2‘crypto-, comb. form’. In: OED Online. Hämtad den 5 april 2013. Oxford

University Press, Mar. 2013. URL: http://www.oed.com/view/Entry/45363.

3‘graphy-, comb. form’. In: OED Online. Hämtad den 5 april 2013. Oxford

University Press, Mar. 2013. URL: http://www.oed.com/view/Entry/80855.

Daniel Bosk KTH/MIUN A High-Level Overview of Cryptography 3

slide-4
SLIDE 4

Introduction Shared-key cryptography Public-key cryptography More counter-intuitive things References History

The word has its origin in greek1: κρυπτς (kryptos) meaning hidden2. γρφος (graphos) meaning writing3. The area has been around for ages. We should not confuse it with steganography. Steganography concerns hiding a message’s existence. Cryptography concerns hiding a message’s contents.

1‘cryptography, n.’. In: OED Online. Hämtad den 5 april 2013. Oxford

University Press, Mar. 2013. URL: http://www.oed.com/view/Entry/45374?redirectedFrom=cryptography&.

2‘crypto-, comb. form’. In: OED Online. Hämtad den 5 april 2013. Oxford

University Press, Mar. 2013. URL: http://www.oed.com/view/Entry/45363.

3‘graphy-, comb. form’. In: OED Online. Hämtad den 5 april 2013. Oxford

University Press, Mar. 2013. URL: http://www.oed.com/view/Entry/80855.

Daniel Bosk KTH/MIUN A High-Level Overview of Cryptography 3

slide-5
SLIDE 5

Introduction Shared-key cryptography Public-key cryptography More counter-intuitive things References History

The word has its origin in greek1: κρυπτς (kryptos) meaning hidden2. γρφος (graphos) meaning writing3. The area has been around for ages. We should not confuse it with steganography. Steganography concerns hiding a message’s existence. Cryptography concerns hiding a message’s contents.

1‘cryptography, n.’. In: OED Online. Hämtad den 5 april 2013. Oxford

University Press, Mar. 2013. URL: http://www.oed.com/view/Entry/45374?redirectedFrom=cryptography&.

2‘crypto-, comb. form’. In: OED Online. Hämtad den 5 april 2013. Oxford

University Press, Mar. 2013. URL: http://www.oed.com/view/Entry/45363.

3‘graphy-, comb. form’. In: OED Online. Hämtad den 5 april 2013. Oxford

University Press, Mar. 2013. URL: http://www.oed.com/view/Entry/80855.

Daniel Bosk KTH/MIUN A High-Level Overview of Cryptography 3

slide-6
SLIDE 6

Introduction Shared-key cryptography Public-key cryptography More counter-intuitive things References History

Then it was an art, now it’s a science. People used ‘clever’ constructions. These were thought to be secure: ‘How can anyone figure this

  • ut?’

Well, it turns out that there are always a lot of people with a lot of time and motivation . . .

Daniel Bosk KTH/MIUN A High-Level Overview of Cryptography 4

slide-7
SLIDE 7

Introduction Shared-key cryptography Public-key cryptography More counter-intuitive things References History

Then it was an art, now it’s a science. People used ‘clever’ constructions. These were thought to be secure: ‘How can anyone figure this

  • ut?’

Well, it turns out that there are always a lot of people with a lot of time and motivation . . .

Daniel Bosk KTH/MIUN A High-Level Overview of Cryptography 4

slide-8
SLIDE 8

Introduction Shared-key cryptography Public-key cryptography More counter-intuitive things References History

Then it was an art, now it’s a science. People used ‘clever’ constructions. These were thought to be secure: ‘How can anyone figure this

  • ut?’

Well, it turns out that there are always a lot of people with a lot of time and motivation . . .

Daniel Bosk KTH/MIUN A High-Level Overview of Cryptography 4

slide-9
SLIDE 9

Introduction Shared-key cryptography Public-key cryptography More counter-intuitive things References Kerckhoff’s Principle

A quote4 [A cryptosystem] should not require secrecy, and it should not be a problem if it falls into the enemy hands; Kerckhoff’s Principle No security-by-obscurity The key should be the only secret

4Auguste Kerckhoff. ‘La cryptographie militaire’. In: Journal des sciences

militaires 9 (1883), pp. 5–38, 161–191.

Daniel Bosk KTH/MIUN A High-Level Overview of Cryptography 5

slide-10
SLIDE 10

Introduction Shared-key cryptography Public-key cryptography More counter-intuitive things References Kerckhoff’s Principle

A quote4 [A cryptosystem] should not require secrecy, and it should not be a problem if it falls into the enemy hands; Kerckhoff’s Principle No security-by-obscurity The key should be the only secret

4Auguste Kerckhoff. ‘La cryptographie militaire’. In: Journal des sciences

militaires 9 (1883), pp. 5–38, 161–191.

Daniel Bosk KTH/MIUN A High-Level Overview of Cryptography 5

slide-11
SLIDE 11

Introduction Shared-key cryptography Public-key cryptography More counter-intuitive things References Kerckhoff’s Principle

Note This doesn’t mean we must tell the adversary what we’re using. But we shouldn’t loose any security if we do.

Daniel Bosk KTH/MIUN A High-Level Overview of Cryptography 6

slide-12
SLIDE 12

Introduction Shared-key cryptography Public-key cryptography More counter-intuitive things References Outline

Shared-key Stems from the classical crypto where a key is shared between two users. Public-key This is more modern crypto, from 1970s. Each user has a public and a private key. Counter-intuitive More modern, from 1980s and onwards. How to do computations on secret inputs, prove knowledge without revealing of what.

Daniel Bosk KTH/MIUN A High-Level Overview of Cryptography 7

slide-13
SLIDE 13

Introduction Shared-key cryptography Public-key cryptography More counter-intuitive things References Outline

Shared-key Stems from the classical crypto where a key is shared between two users. Public-key This is more modern crypto, from 1970s. Each user has a public and a private key. Counter-intuitive More modern, from 1980s and onwards. How to do computations on secret inputs, prove knowledge without revealing of what.

Daniel Bosk KTH/MIUN A High-Level Overview of Cryptography 7

slide-14
SLIDE 14

Introduction Shared-key cryptography Public-key cryptography More counter-intuitive things References Outline

Shared-key Stems from the classical crypto where a key is shared between two users. Public-key This is more modern crypto, from 1970s. Each user has a public and a private key. Counter-intuitive More modern, from 1980s and onwards. How to do computations on secret inputs, prove knowledge without revealing of what.

Daniel Bosk KTH/MIUN A High-Level Overview of Cryptography 7

slide-15
SLIDE 15

Introduction Shared-key cryptography Public-key cryptography More counter-intuitive things References

1 Introduction

History Kerckhoff’s Principle Outline

2 Shared-key cryptography

Ciphers Security Hash functions Message-authentication codes

3 Public-key cryptography

Key-exchange schemes Encryption and decryption Digital signatures Homomorphic properties

4 More counter-intuitive things

Secure multi-party computation Zero-knowledge proofs of knowledge

Daniel Bosk KTH/MIUN A High-Level Overview of Cryptography 8

slide-16
SLIDE 16

Introduction Shared-key cryptography Public-key cryptography More counter-intuitive things References Ciphers

Idea Alice and Bob share a (small) common secret. Alice takes a message, combines it with the secret, sends it to Bob. If Eve captures the whatever Alice sent, she shouldn’t learn anything about the message. Bob combines what he received with the secret and gets the message.

Daniel Bosk KTH/MIUN A High-Level Overview of Cryptography 9

slide-17
SLIDE 17

Introduction Shared-key cryptography Public-key cryptography More counter-intuitive things References Ciphers

Idea Alice and Bob share a (small) common secret. Alice takes a message, combines it with the secret, sends it to Bob. If Eve captures the whatever Alice sent, she shouldn’t learn anything about the message. Bob combines what he received with the secret and gets the message.

Daniel Bosk KTH/MIUN A High-Level Overview of Cryptography 9

slide-18
SLIDE 18

Introduction Shared-key cryptography Public-key cryptography More counter-intuitive things References Ciphers

Idea Alice and Bob share a (small) common secret. Alice takes a message, combines it with the secret, sends it to Bob. If Eve captures the whatever Alice sent, she shouldn’t learn anything about the message. Bob combines what he received with the secret and gets the message.

Daniel Bosk KTH/MIUN A High-Level Overview of Cryptography 9

slide-19
SLIDE 19

Introduction Shared-key cryptography Public-key cryptography More counter-intuitive things References Ciphers

Idea Alice and Bob share a (small) common secret. Alice takes a message, combines it with the secret, sends it to Bob. If Eve captures the whatever Alice sent, she shouldn’t learn anything about the message. Bob combines what he received with the secret and gets the message.

Daniel Bosk KTH/MIUN A High-Level Overview of Cryptography 9

slide-20
SLIDE 20

Introduction Shared-key cryptography Public-key cryptography More counter-intuitive things References Ciphers

Block-cipher encryption Input A fixed-sized key k, a fixed-sized block of plaintext p. Output A fixed-sized block of ciphertext c. Notation Enck(p) = c Block-cipher decryption Input A fixed-sized key k, a fixed-sized block of ciphertext c. Output A fixed-sized block of plaintext p. Notation Deck(c) = p

Daniel Bosk KTH/MIUN A High-Level Overview of Cryptography 10

slide-21
SLIDE 21

Introduction Shared-key cryptography Public-key cryptography More counter-intuitive things References Ciphers

Block-cipher encryption Input A fixed-sized key k, a fixed-sized block of plaintext p. Output A fixed-sized block of ciphertext c. Notation Enck(p) = c Block-cipher decryption Input A fixed-sized key k, a fixed-sized block of ciphertext c. Output A fixed-sized block of plaintext p. Notation Deck(c) = p

Daniel Bosk KTH/MIUN A High-Level Overview of Cryptography 10

slide-22
SLIDE 22

Introduction Shared-key cryptography Public-key cryptography More counter-intuitive things References Ciphers

Definition (Crypto system5) A crypto system is a tuple (M, C, K, E, D), where:

M is a finite set of plaintexts or messages, C is a finite set of ciphertexts, K is the keyspace, a finite set of keys. E and D are the sets of encryption and decryption rules, respectively.

For every k ∈ K there is a Enck ∈ E and Deck ∈ D such that

Enck : M → C and Deck : C → M are functions and Deck(Enck(m)) = m for all plaintexts m ∈ M.

5Douglas R. Stinson. Cryptography: Theory and Practice. 3rd ed. Boca

Raton: Chapman & Hall/CRC, 2006. ISBN: 1-58488-508-4 (Hardcover).

Daniel Bosk KTH/MIUN A High-Level Overview of Cryptography 11

slide-23
SLIDE 23

Introduction Shared-key cryptography Public-key cryptography More counter-intuitive things References Ciphers

Definition (Crypto system5) A crypto system is a tuple (M, C, K, E, D), where:

M is a finite set of plaintexts or messages, C is a finite set of ciphertexts, K is the keyspace, a finite set of keys. E and D are the sets of encryption and decryption rules, respectively.

For every k ∈ K there is a Enck ∈ E and Deck ∈ D such that

Enck : M → C and Deck : C → M are functions and Deck(Enck(m)) = m for all plaintexts m ∈ M.

5Douglas R. Stinson. Cryptography: Theory and Practice. 3rd ed. Boca

Raton: Chapman & Hall/CRC, 2006. ISBN: 1-58488-508-4 (Hardcover).

Daniel Bosk KTH/MIUN A High-Level Overview of Cryptography 11

slide-24
SLIDE 24

Introduction Shared-key cryptography Public-key cryptography More counter-intuitive things References Ciphers

Definition (Shift Cipher) Let M = C = K = Z29 For each k ∈ K we define Enck(m) = (m + k) mod 29, m ∈ M, och Deck(c) = (c − k) mod 29, c ∈ C . Example Enc3(7) = 7 + 3 mod 29 = 10 h→J Enc3(4) = 4 + 3 mod 29 = 7 e→G Enc3(9) = 9 + 3 mod 29 = 12 j→L

Daniel Bosk KTH/MIUN A High-Level Overview of Cryptography 12

slide-25
SLIDE 25

Introduction Shared-key cryptography Public-key cryptography More counter-intuitive things References Ciphers

Definition (Shift Cipher) Let M = C = K = Z29 For each k ∈ K we define Enck(m) = (m + k) mod 29, m ∈ M, och Deck(c) = (c − k) mod 29, c ∈ C . Example Enc3(7) = 7 + 3 mod 29 = 10 h→J Enc3(4) = 4 + 3 mod 29 = 7 e→G Enc3(9) = 9 + 3 mod 29 = 12 j→L

Daniel Bosk KTH/MIUN A High-Level Overview of Cryptography 12

slide-26
SLIDE 26

Introduction Shared-key cryptography Public-key cryptography More counter-intuitive things References Ciphers

Note The shift cipher is a classical cipher — also know as the Caesar Cipher. It’s easily broken by hand! It’s used here for illustrative purposes.

Daniel Bosk KTH/MIUN A High-Level Overview of Cryptography 13

slide-27
SLIDE 27

Introduction Shared-key cryptography Public-key cryptography More counter-intuitive things References Ciphers

Exercise What do we have to do to set this up between two parties, say Alice and Bob? What problems do we have to solve?

Daniel Bosk KTH/MIUN A High-Level Overview of Cryptography 14

slide-28
SLIDE 28

Introduction Shared-key cryptography Public-key cryptography More counter-intuitive things References Security

Definition (Perfect secrecy6) Cryptosystem (M, C, K, E, D). Stochastic variables M, C. Perfect secrecy if and only if Pr(M = m | C = c) = Pr(M = m) for all m ∈ M and c ∈ C. Note Equivalent to H(M | C) = H(M), i.e. ciphertext does not reveal anything about plaintext.

6Claude E Shannon. ‘Communication theory of secrecy systems’. In: Bell

system technical journal 28.4 (1949), pp. 656–715.

Daniel Bosk KTH/MIUN A High-Level Overview of Cryptography 15

slide-29
SLIDE 29

Introduction Shared-key cryptography Public-key cryptography More counter-intuitive things References Security

Definition (Perfect secrecy6) Cryptosystem (M, C, K, E, D). Stochastic variables M, C. Perfect secrecy if and only if Pr(M = m | C = c) = Pr(M = m) for all m ∈ M and c ∈ C. Note Equivalent to H(M | C) = H(M), i.e. ciphertext does not reveal anything about plaintext.

6Claude E Shannon. ‘Communication theory of secrecy systems’. In: Bell

system technical journal 28.4 (1949), pp. 656–715.

Daniel Bosk KTH/MIUN A High-Level Overview of Cryptography 15

slide-30
SLIDE 30

Introduction Shared-key cryptography Public-key cryptography More counter-intuitive things References Security

Theorem (Shannon’s theorem) Assume cryptosystem (M, C, K, E, D) such that | K | = | C | = | M |. This provides perfect secrecy if and only if

1 every key k ∈ K is used with equal probability 1/| K |, 2 for every plaintext m ∈ M and c ∈ C there is a unique key

such that Enck(m) = c.

Daniel Bosk KTH/MIUN A High-Level Overview of Cryptography 16

slide-31
SLIDE 31

Introduction Shared-key cryptography Public-key cryptography More counter-intuitive things References Security

Theorem (Shannon’s theorem) Assume cryptosystem (M, C, K, E, D) such that | K | = | C | = | M |. This provides perfect secrecy if and only if

1 every key k ∈ K is used with equal probability 1/| K |, 2 for every plaintext m ∈ M and c ∈ C there is a unique key

such that Enck(m) = c.

Daniel Bosk KTH/MIUN A High-Level Overview of Cryptography 16

slide-32
SLIDE 32

Introduction Shared-key cryptography Public-key cryptography More counter-intuitive things References Security

Example (One-time Pad) Let n be a positive integer. Let M = C = K = (Z2)n. For each key k = (k1, . . . , kn) ∈ K, plaintexts m = (m1, . . . , mn) ∈ M and ciphertexts c = (c1, . . . , cn) ∈ C we define Enck(m) = (m1 + k1, . . . , mn + kn) We also define Dec = Enc. k ∈ K must be chosen uniformly randomly for each encryption.

Daniel Bosk KTH/MIUN A High-Level Overview of Cryptography 17

slide-33
SLIDE 33

Introduction Shared-key cryptography Public-key cryptography More counter-intuitive things References Security

Example (One-time Pad) Let n be a positive integer. Let M = C = K = (Z2)n. For each key k = (k1, . . . , kn) ∈ K, plaintexts m = (m1, . . . , mn) ∈ M and ciphertexts c = (c1, . . . , cn) ∈ C we define Enck(m) = (m1 + k1, . . . , mn + kn) We also define Dec = Enc. k ∈ K must be chosen uniformly randomly for each encryption.

Daniel Bosk KTH/MIUN A High-Level Overview of Cryptography 17

slide-34
SLIDE 34

Introduction Shared-key cryptography Public-key cryptography More counter-intuitive things References Security

Example (One-time Pad) Let n be a positive integer. Let M = C = K = (Z2)n. For each key k = (k1, . . . , kn) ∈ K, plaintexts m = (m1, . . . , mn) ∈ M and ciphertexts c = (c1, . . . , cn) ∈ C we define Enck(m) = (m1 + k1, . . . , mn + kn) We also define Dec = Enc. k ∈ K must be chosen uniformly randomly for each encryption.

Daniel Bosk KTH/MIUN A High-Level Overview of Cryptography 17

slide-35
SLIDE 35

Introduction Shared-key cryptography Public-key cryptography More counter-intuitive things References Security

Example (One-time Pad) Let n be a positive integer. Let M = C = K = (Z2)n. For each key k = (k1, . . . , kn) ∈ K, plaintexts m = (m1, . . . , mn) ∈ M and ciphertexts c = (c1, . . . , cn) ∈ C we define Enck(m) = (m1 + k1, . . . , mn + kn) We also define Dec = Enc. k ∈ K must be chosen uniformly randomly for each encryption.

Daniel Bosk KTH/MIUN A High-Level Overview of Cryptography 17

slide-36
SLIDE 36

Introduction Shared-key cryptography Public-key cryptography More counter-intuitive things References Security

Definition (Pseudo-random permutation, PRP7) Let F : {0, 1}s × {0, 1}n → {0, 1}n. F is a PRP if

1 for any k ∈ {0, 1}s, F is a bijection; 2 for any k ∈ {0, 1}s, we can ‘efficiently’ evaluate Fk(x); 3 for all ‘efficient’ distinguishers D,

  • Pr[DFk(1n) = 1] − Pr[Dfn(1n) = 1]
  • < ǫ(s)

if we choose k ∈ {0, 1}s and the random permutation fn uniformly at random.

7Jonathan Katz and Yehuda Lindell. Introduction to modern cryptography.

1st ed. Boca Raton: Chapman & Hall/CRC, 2008. ISBN: 9781584885511.

Daniel Bosk KTH/MIUN A High-Level Overview of Cryptography 18

slide-37
SLIDE 37

Introduction Shared-key cryptography Public-key cryptography More counter-intuitive things References Security

Definition (Pseudo-random permutation, PRP7) Let F : {0, 1}s × {0, 1}n → {0, 1}n. F is a PRP if

1 for any k ∈ {0, 1}s, F is a bijection; 2 for any k ∈ {0, 1}s, we can ‘efficiently’ evaluate Fk(x); 3 for all ‘efficient’ distinguishers D,

  • Pr[DFk(1n) = 1] − Pr[Dfn(1n) = 1]
  • < ǫ(s)

if we choose k ∈ {0, 1}s and the random permutation fn uniformly at random.

7Jonathan Katz and Yehuda Lindell. Introduction to modern cryptography.

1st ed. Boca Raton: Chapman & Hall/CRC, 2008. ISBN: 9781584885511.

Daniel Bosk KTH/MIUN A High-Level Overview of Cryptography 18

slide-38
SLIDE 38

Introduction Shared-key cryptography Public-key cryptography More counter-intuitive things References Security

Definition (Pseudo-random permutation, PRP7) Let F : {0, 1}s × {0, 1}n → {0, 1}n. F is a PRP if

1 for any k ∈ {0, 1}s, F is a bijection; 2 for any k ∈ {0, 1}s, we can ‘efficiently’ evaluate Fk(x); 3 for all ‘efficient’ distinguishers D,

  • Pr[DFk(1n) = 1] − Pr[Dfn(1n) = 1]
  • < ǫ(s)

if we choose k ∈ {0, 1}s and the random permutation fn uniformly at random.

7Jonathan Katz and Yehuda Lindell. Introduction to modern cryptography.

1st ed. Boca Raton: Chapman & Hall/CRC, 2008. ISBN: 9781584885511.

Daniel Bosk KTH/MIUN A High-Level Overview of Cryptography 18

slide-39
SLIDE 39

Introduction Shared-key cryptography Public-key cryptography More counter-intuitive things References Security

Definition (Pseudo-random permutation, PRP7) Let F : {0, 1}s × {0, 1}n → {0, 1}n. F is a PRP if

1 for any k ∈ {0, 1}s, F is a bijection; 2 for any k ∈ {0, 1}s, we can ‘efficiently’ evaluate Fk(x); 3 for all ‘efficient’ distinguishers D,

  • Pr[DFk(1n) = 1] − Pr[Dfn(1n) = 1]
  • < ǫ(s)

if we choose k ∈ {0, 1}s and the random permutation fn uniformly at random.

7Jonathan Katz and Yehuda Lindell. Introduction to modern cryptography.

1st ed. Boca Raton: Chapman & Hall/CRC, 2008. ISBN: 9781584885511.

Daniel Bosk KTH/MIUN A High-Level Overview of Cryptography 18

slide-40
SLIDE 40

Introduction Shared-key cryptography Public-key cryptography More counter-intuitive things References Hash functions

Idea We want a function which we can efficiently compute. However, it shouldn’t be possible to find its inverse. Example Easy f (x) = y Hard f −1(y) = x

Daniel Bosk KTH/MIUN A High-Level Overview of Cryptography 19

slide-41
SLIDE 41

Introduction Shared-key cryptography Public-key cryptography More counter-intuitive things References Hash functions

Idea We want a function which we can efficiently compute. However, it shouldn’t be possible to find its inverse. Example Easy f (x) = y Hard f −1(y) = x

Daniel Bosk KTH/MIUN A High-Level Overview of Cryptography 19

slide-42
SLIDE 42

Introduction Shared-key cryptography Public-key cryptography More counter-intuitive things References Hash functions

Idea We want a function which we can efficiently compute. However, it shouldn’t be possible to find its inverse. Example Easy f (x) = y Hard f −1(y) = x

Daniel Bosk KTH/MIUN A High-Level Overview of Cryptography 19

slide-43
SLIDE 43

Introduction Shared-key cryptography Public-key cryptography More counter-intuitive things References Hash functions

X

1 2 3 4

Y

D B C

(a)

h: X → Y

A B C AB AC BC ABC 1 2 3 X Y

(b) h′ : X → Y Figure: Two non-injective, surjective functions h and h′.

Exercise Could either of these two functions be one-way functions?

Daniel Bosk KTH/MIUN A High-Level Overview of Cryptography 20

slide-44
SLIDE 44

Introduction Shared-key cryptography Public-key cryptography More counter-intuitive things References Hash functions

Definition (One-way function8) Let h: {0, 1}∗ → {0, 1}∗. h is one-way if

1 there exists an efficient algorithm A such that A(x) = h(x); 2 for every efficient algorithm A′, every positive polynomial p(·)

and all sufficiently large n’s Pr

  • A′(h(x), 1n) ∈ h−1(h(x))
  • <

1 p(n)

8Oded Goldreich. Foundations of cryptography, Vol. 1: Basic tools.

Cambridge: Cambridge Univ. Press, 2001. ISBN: 0-521-79172-3.

Daniel Bosk KTH/MIUN A High-Level Overview of Cryptography 21

slide-45
SLIDE 45

Introduction Shared-key cryptography Public-key cryptography More counter-intuitive things References Hash functions

Example (Implementations you might’ve heard of) MD5 SHA1 SHA256 (SHA-2) SHA-3 Example (Applications) Verifying file content integrity Digital signatures Protect passwords

Daniel Bosk KTH/MIUN A High-Level Overview of Cryptography 22

slide-46
SLIDE 46

Introduction Shared-key cryptography Public-key cryptography More counter-intuitive things References Hash functions

Note One-wayness returns as a useful property in many situations. Encryption also has the one-wayness property: Easy Given k, m, compute c ← Enck(m). Hard Given c, compute either of k, m. However, encryption is bijective, hash functions are generally not.

Daniel Bosk KTH/MIUN A High-Level Overview of Cryptography 23

slide-47
SLIDE 47

Introduction Shared-key cryptography Public-key cryptography More counter-intuitive things References Message-authentication codes

Example Let Enck(·) = Deck(·) = · ⊕ k mod 2. Alice and Bob share k. Alice sends Enck(m) = c to Bob. Eve intercepts c, she cannot get to m. Eve computes c′ = c ⊕ mE and passes c′ to Bob. Bob computes Deck(c′) = Deck(c ⊕ mE) = m ⊕ k ⊕ mE ⊕ k = m ⊕ mE. Exercise How can we solve this? Bob needs to know that Eve modified the message!

Daniel Bosk KTH/MIUN A High-Level Overview of Cryptography 24

slide-48
SLIDE 48

Introduction Shared-key cryptography Public-key cryptography More counter-intuitive things References Message-authentication codes

Example Let Enck(·) = Deck(·) = · ⊕ k mod 2. Alice and Bob share k. Alice sends Enck(m) = c to Bob. Eve intercepts c, she cannot get to m. Eve computes c′ = c ⊕ mE and passes c′ to Bob. Bob computes Deck(c′) = Deck(c ⊕ mE) = m ⊕ k ⊕ mE ⊕ k = m ⊕ mE. Exercise How can we solve this? Bob needs to know that Eve modified the message!

Daniel Bosk KTH/MIUN A High-Level Overview of Cryptography 24

slide-49
SLIDE 49

Introduction Shared-key cryptography Public-key cryptography More counter-intuitive things References Message-authentication codes

Example Let Enck(·) = Deck(·) = · ⊕ k mod 2. Alice and Bob share k. Alice sends Enck(m) = c to Bob. Eve intercepts c, she cannot get to m. Eve computes c′ = c ⊕ mE and passes c′ to Bob. Bob computes Deck(c′) = Deck(c ⊕ mE) = m ⊕ k ⊕ mE ⊕ k = m ⊕ mE. Exercise How can we solve this? Bob needs to know that Eve modified the message!

Daniel Bosk KTH/MIUN A High-Level Overview of Cryptography 24

slide-50
SLIDE 50

Introduction Shared-key cryptography Public-key cryptography More counter-intuitive things References Message-authentication codes

Example Let Enck(·) = Deck(·) = · ⊕ k mod 2. Alice and Bob share k. Alice sends Enck(m) = c to Bob. Eve intercepts c, she cannot get to m. Eve computes c′ = c ⊕ mE and passes c′ to Bob. Bob computes Deck(c′) = Deck(c ⊕ mE) = m ⊕ k ⊕ mE ⊕ k = m ⊕ mE. Exercise How can we solve this? Bob needs to know that Eve modified the message!

Daniel Bosk KTH/MIUN A High-Level Overview of Cryptography 24

slide-51
SLIDE 51

Introduction Shared-key cryptography Public-key cryptography More counter-intuitive things References Message-authentication codes

Example Let Enck(·) = Deck(·) = · ⊕ k mod 2. Alice and Bob share k. Alice sends Enck(m) = c to Bob. Eve intercepts c, she cannot get to m. Eve computes c′ = c ⊕ mE and passes c′ to Bob. Bob computes Deck(c′) = Deck(c ⊕ mE) = m ⊕ k ⊕ mE ⊕ k = m ⊕ mE. Exercise How can we solve this? Bob needs to know that Eve modified the message!

Daniel Bosk KTH/MIUN A High-Level Overview of Cryptography 24

slide-52
SLIDE 52

Introduction Shared-key cryptography Public-key cryptography More counter-intuitive things References Message-authentication codes

Example Let Enck(·) = Deck(·) = · ⊕ k mod 2. Alice and Bob share k. Alice sends Enck(m) = c to Bob. Eve intercepts c, she cannot get to m. Eve computes c′ = c ⊕ mE and passes c′ to Bob. Bob computes Deck(c′) = Deck(c ⊕ mE) = m ⊕ k ⊕ mE ⊕ k = m ⊕ mE. Exercise How can we solve this? Bob needs to know that Eve modified the message!

Daniel Bosk KTH/MIUN A High-Level Overview of Cryptography 24

slide-53
SLIDE 53

Introduction Shared-key cryptography Public-key cryptography More counter-intuitive things References Message-authentication codes

Idea: MACs Alice and Bob need something that Eve doesn’t know how to modify. If that something is tied to the message, then a modified message would be detectable. Exercise Any ideas on how we can construct such a thing?

Daniel Bosk KTH/MIUN A High-Level Overview of Cryptography 25

slide-54
SLIDE 54

Introduction Shared-key cryptography Public-key cryptography More counter-intuitive things References Message-authentication codes

Idea: MACs Alice and Bob need something that Eve doesn’t know how to modify. If that something is tied to the message, then a modified message would be detectable. Exercise Any ideas on how we can construct such a thing?

Daniel Bosk KTH/MIUN A High-Level Overview of Cryptography 25

slide-55
SLIDE 55

Introduction Shared-key cryptography Public-key cryptography More counter-intuitive things References Message-authentication codes

Idea: MACs Alice and Bob need something that Eve doesn’t know how to modify. If that something is tied to the message, then a modified message would be detectable. Exercise Any ideas on how we can construct such a thing?

Daniel Bosk KTH/MIUN A High-Level Overview of Cryptography 25

slide-56
SLIDE 56

Introduction Shared-key cryptography Public-key cryptography More counter-intuitive things References Message-authentication codes

Example Let h be a one-way function. If we use h(c) = t, then Eve can also compute the hash function: h(c′) = t′. A secret hash function would violate Kerckhoff’s principle, so that’s not an option. If we instead use the message, rather than the ciphertext. Then h(m) = t and

Deck(c′) = m′ = m ⊕ mE, h(m′) = t. Deck(c) = m, h(m) = t.

Eve cannot compute the hash function, she doesn’t have m!

Bob: But neither do I!

Daniel Bosk KTH/MIUN A High-Level Overview of Cryptography 26

slide-57
SLIDE 57

Introduction Shared-key cryptography Public-key cryptography More counter-intuitive things References Message-authentication codes

Example Let h be a one-way function. If we use h(c) = t, then Eve can also compute the hash function: h(c′) = t′. A secret hash function would violate Kerckhoff’s principle, so that’s not an option. If we instead use the message, rather than the ciphertext. Then h(m) = t and

Deck(c′) = m′ = m ⊕ mE, h(m′) = t. Deck(c) = m, h(m) = t.

Eve cannot compute the hash function, she doesn’t have m!

Bob: But neither do I!

Daniel Bosk KTH/MIUN A High-Level Overview of Cryptography 26

slide-58
SLIDE 58

Introduction Shared-key cryptography Public-key cryptography More counter-intuitive things References Message-authentication codes

Example Let h be a one-way function. If we use h(c) = t, then Eve can also compute the hash function: h(c′) = t′. A secret hash function would violate Kerckhoff’s principle, so that’s not an option. If we instead use the message, rather than the ciphertext. Then h(m) = t and

Deck(c′) = m′ = m ⊕ mE, h(m′) = t. Deck(c) = m, h(m) = t.

Eve cannot compute the hash function, she doesn’t have m!

Bob: But neither do I!

Daniel Bosk KTH/MIUN A High-Level Overview of Cryptography 26

slide-59
SLIDE 59

Introduction Shared-key cryptography Public-key cryptography More counter-intuitive things References Message-authentication codes

Example Let h be a one-way function. If we use h(c) = t, then Eve can also compute the hash function: h(c′) = t′. A secret hash function would violate Kerckhoff’s principle, so that’s not an option. If we instead use the message, rather than the ciphertext. Then h(m) = t and

Deck(c′) = m′ = m ⊕ mE, h(m′) = t. Deck(c) = m, h(m) = t.

Eve cannot compute the hash function, she doesn’t have m!

Bob: But neither do I!

Daniel Bosk KTH/MIUN A High-Level Overview of Cryptography 26

slide-60
SLIDE 60

Introduction Shared-key cryptography Public-key cryptography More counter-intuitive things References Message-authentication codes

Example Let h be a one-way function. If we use h(c) = t, then Eve can also compute the hash function: h(c′) = t′. A secret hash function would violate Kerckhoff’s principle, so that’s not an option. If we instead use the message, rather than the ciphertext. Then h(m) = t and

Deck(c′) = m′ = m ⊕ mE, h(m′) = t. Deck(c) = m, h(m) = t.

Eve cannot compute the hash function, she doesn’t have m!

Bob: But neither do I!

Daniel Bosk KTH/MIUN A High-Level Overview of Cryptography 26

slide-61
SLIDE 61

Introduction Shared-key cryptography Public-key cryptography More counter-intuitive things References Message-authentication codes

Example Let h be a one-way function. If we use h(c) = t, then Eve can also compute the hash function: h(c′) = t′. A secret hash function would violate Kerckhoff’s principle, so that’s not an option. If we instead use the message, rather than the ciphertext. Then h(m) = t and

Deck(c′) = m′ = m ⊕ mE, h(m′) = t. Deck(c) = m, h(m) = t.

Eve cannot compute the hash function, she doesn’t have m!

Bob: But neither do I!

Daniel Bosk KTH/MIUN A High-Level Overview of Cryptography 26

slide-62
SLIDE 62

Introduction Shared-key cryptography Public-key cryptography More counter-intuitive things References Message-authentication codes

Solution Let s be a secret shared between Alice and Bob. h(c s) = t, Eve doesn’t know s. Bob can immediately check h(c′ s) = t. Note It requires even a bit more than this! But the idea is correct.

Daniel Bosk KTH/MIUN A High-Level Overview of Cryptography 27

slide-63
SLIDE 63

Introduction Shared-key cryptography Public-key cryptography More counter-intuitive things References Message-authentication codes

Solution Let s be a secret shared between Alice and Bob. h(c s) = t, Eve doesn’t know s. Bob can immediately check h(c′ s) = t. Note It requires even a bit more than this! But the idea is correct.

Daniel Bosk KTH/MIUN A High-Level Overview of Cryptography 27

slide-64
SLIDE 64

Introduction Shared-key cryptography Public-key cryptography More counter-intuitive things References Message-authentication codes

Solution Let s be a secret shared between Alice and Bob. h(c s) = t, Eve doesn’t know s. Bob can immediately check h(c′ s) = t. Note It requires even a bit more than this! But the idea is correct.

Daniel Bosk KTH/MIUN A High-Level Overview of Cryptography 27

slide-65
SLIDE 65

Introduction Shared-key cryptography Public-key cryptography More counter-intuitive things References Message-authentication codes

Solution (Hash-based message-authentication code, HMAC9) Let h be a one-way function. Let c be the ciphertext, s our MA secret. Then tag t = HMACs(c), where HMACs(c) = h [(s ⊕ po) h [(s ⊕ pi) c]] , and pi, po are inner and outer pads, respectively. Note This is proven secure in by Bellare, Canetti and Krawczyk [9]!

9Mihir Bellare, Ran Canetti and Hugo Krawczyk. ‘Keying Hash Functions

for Message Authentication’. In: Advances in Cryptology — CRYPTO ’96: Prooceedings of the 16th Annual International Cryptology Conference. Ed. by Neal Koblitz. Berlin, Heidelberg: Springer Berlin Heidelberg, 1996, pp. 1–15. ISBN: 978-3-540-68697-2. DOI: 10.1007/3-540-68697-5_1. URL:

Daniel Bosk KTH/MIUN A High-Level Overview of Cryptography 28

slide-66
SLIDE 66

Introduction Shared-key cryptography Public-key cryptography More counter-intuitive things References Message-authentication codes

Solution (Hash-based message-authentication code, HMAC9) Let h be a one-way function. Let c be the ciphertext, s our MA secret. Then tag t = HMACs(c), where HMACs(c) = h [(s ⊕ po) h [(s ⊕ pi) c]] , and pi, po are inner and outer pads, respectively. Note This is proven secure in by Bellare, Canetti and Krawczyk [9]!

9Mihir Bellare, Ran Canetti and Hugo Krawczyk. ‘Keying Hash Functions

for Message Authentication’. In: Advances in Cryptology — CRYPTO ’96: Prooceedings of the 16th Annual International Cryptology Conference. Ed. by Neal Koblitz. Berlin, Heidelberg: Springer Berlin Heidelberg, 1996, pp. 1–15. ISBN: 978-3-540-68697-2. DOI: 10.1007/3-540-68697-5_1. URL:

Daniel Bosk KTH/MIUN A High-Level Overview of Cryptography 28

slide-67
SLIDE 67

Introduction Shared-key cryptography Public-key cryptography More counter-intuitive things References Message-authentication codes

Solution (Hash-based message-authentication code, HMAC9) Let h be a one-way function. Let c be the ciphertext, s our MA secret. Then tag t = HMACs(c), where HMACs(c) = h [(s ⊕ po) h [(s ⊕ pi) c]] , and pi, po are inner and outer pads, respectively. Note This is proven secure in by Bellare, Canetti and Krawczyk [9]!

9Mihir Bellare, Ran Canetti and Hugo Krawczyk. ‘Keying Hash Functions

for Message Authentication’. In: Advances in Cryptology — CRYPTO ’96: Prooceedings of the 16th Annual International Cryptology Conference. Ed. by Neal Koblitz. Berlin, Heidelberg: Springer Berlin Heidelberg, 1996, pp. 1–15. ISBN: 978-3-540-68697-2. DOI: 10.1007/3-540-68697-5_1. URL:

Daniel Bosk KTH/MIUN A High-Level Overview of Cryptography 28

slide-68
SLIDE 68

Introduction Shared-key cryptography Public-key cryptography More counter-intuitive things References

1 Introduction

History Kerckhoff’s Principle Outline

2 Shared-key cryptography

Ciphers Security Hash functions Message-authentication codes

3 Public-key cryptography

Key-exchange schemes Encryption and decryption Digital signatures Homomorphic properties

4 More counter-intuitive things

Secure multi-party computation Zero-knowledge proofs of knowledge

Daniel Bosk KTH/MIUN A High-Level Overview of Cryptography 29

slide-69
SLIDE 69

Introduction Shared-key cryptography Public-key cryptography More counter-intuitive things References Key-exchange schemes

Idea It’s difficult to have to exchange keys in advance. What if we could securely exchange keys at a distance? If we could do it just before we use them?

Daniel Bosk KTH/MIUN A High-Level Overview of Cryptography 30

slide-70
SLIDE 70

Introduction Shared-key cryptography Public-key cryptography More counter-intuitive things References Key-exchange schemes

Idea It’s difficult to have to exchange keys in advance. What if we could securely exchange keys at a distance? If we could do it just before we use them?

Daniel Bosk KTH/MIUN A High-Level Overview of Cryptography 30

slide-71
SLIDE 71

Introduction Shared-key cryptography Public-key cryptography More counter-intuitive things References Key-exchange schemes

Solution (Requirements) We need a problem that is easy for Alice and Bob. It should be hard for Eve.

Daniel Bosk KTH/MIUN A High-Level Overview of Cryptography 31

slide-72
SLIDE 72

Introduction Shared-key cryptography Public-key cryptography More counter-intuitive things References Key-exchange schemes

Definition (Discrete Logarithm Problem, DLP) Let Z∗

p be the multiplicative group of residues modulo p ∈ N,

where p is a prime. Given g, gx ∈ Z∗

p

Find x. I.e. compute logg∈Zp(gx).

Daniel Bosk KTH/MIUN A High-Level Overview of Cryptography 32

slide-73
SLIDE 73

Introduction Shared-key cryptography Public-key cryptography More counter-intuitive things References Key-exchange schemes

Definition (Discrete Logarithm Problem, DLP) Let Z∗

p be the multiplicative group of residues modulo p ∈ N,

where p is a prime. Given g, gx ∈ Z∗

p

Find x. I.e. compute logg∈Zp(gx).

Daniel Bosk KTH/MIUN A High-Level Overview of Cryptography 32

slide-74
SLIDE 74

Introduction Shared-key cryptography Public-key cryptography More counter-intuitive things References Key-exchange schemes

Definition (Diffie-Hellman Problem, DHP10) Given g, gx, gy ∈ Z∗

p

Find gxy Definition (Decisional Diffie-Hellman Problem, DDH) Given g, gx, gy, gz ∈ Z∗

p

Decide z ? = xy

10Whitfield Diffie and Martin E Hellman. ‘New directions in cryptography’.

In: IEEE Transactions on Information Theory 22.6 (1976), pp. 644–654.

Daniel Bosk KTH/MIUN A High-Level Overview of Cryptography 33

slide-75
SLIDE 75

Introduction Shared-key cryptography Public-key cryptography More counter-intuitive things References Key-exchange schemes

Definition (Diffie-Hellman Problem, DHP10) Given g, gx, gy ∈ Z∗

p

Find gxy Definition (Decisional Diffie-Hellman Problem, DDH) Given g, gx, gy, gz ∈ Z∗

p

Decide z ? = xy

10Whitfield Diffie and Martin E Hellman. ‘New directions in cryptography’.

In: IEEE Transactions on Information Theory 22.6 (1976), pp. 644–654.

Daniel Bosk KTH/MIUN A High-Level Overview of Cryptography 33

slide-76
SLIDE 76

Introduction Shared-key cryptography Public-key cryptography More counter-intuitive things References Key-exchange schemes

If we can solve DLP, then we can solve DHP and DDH too. Maybe DHP and DDH can be solved without DLP. We don’t know yet. We usually assume DLP, DHP and DDH are hard.

Daniel Bosk KTH/MIUN A High-Level Overview of Cryptography 34

slide-77
SLIDE 77

Introduction Shared-key cryptography Public-key cryptography More counter-intuitive things References Key-exchange schemes

If we can solve DLP, then we can solve DHP and DDH too. Maybe DHP and DDH can be solved without DLP. We don’t know yet. We usually assume DLP, DHP and DDH are hard.

Daniel Bosk KTH/MIUN A High-Level Overview of Cryptography 34

slide-78
SLIDE 78

Introduction Shared-key cryptography Public-key cryptography More counter-intuitive things References Key-exchange schemes

If we can solve DLP, then we can solve DHP and DDH too. Maybe DHP and DDH can be solved without DLP. We don’t know yet. We usually assume DLP, DHP and DDH are hard.

Daniel Bosk KTH/MIUN A High-Level Overview of Cryptography 34

slide-79
SLIDE 79

Introduction Shared-key cryptography Public-key cryptography More counter-intuitive things References Key-exchange schemes

Exercise Diffie and Hellman11 used DHP to create a key-exchange protocol. Take some time to figure out how we can use these problems to achieve what we want. Reminder Alice and Bob want to exchange a secret key. Then they can use the key to encrypt their communications.

11Whitfield Diffie and Martin E Hellman. ‘New directions in cryptography’.

In: IEEE Transactions on Information Theory 22.6 (1976), pp. 644–654.

Daniel Bosk KTH/MIUN A High-Level Overview of Cryptography 35

slide-80
SLIDE 80

Introduction Shared-key cryptography Public-key cryptography More counter-intuitive things References Key-exchange schemes

Exercise Diffie and Hellman11 used DHP to create a key-exchange protocol. Take some time to figure out how we can use these problems to achieve what we want. Reminder Alice and Bob want to exchange a secret key. Then they can use the key to encrypt their communications.

11Whitfield Diffie and Martin E Hellman. ‘New directions in cryptography’.

In: IEEE Transactions on Information Theory 22.6 (1976), pp. 644–654.

Daniel Bosk KTH/MIUN A High-Level Overview of Cryptography 35

slide-81
SLIDE 81

Introduction Shared-key cryptography Public-key cryptography More counter-intuitive things References Key-exchange schemes

Definition (Diffie-Hellman key-exchange) Let g ∈ Z∗

p (publicly known, e.g. RFC, standard dots).

Alice generates random 0 < x < | Z∗

p |.

She send gx to Bob. Bob generates random 0 < y < | Z∗

p |.

He sends gy to Alice. Alice has x and g, gy. Bob has g, gx and y. They both compute gxy = (gy)x = (gx)y. Eve has g, gx, gy. By DHP she cannot compute gxy.

Daniel Bosk KTH/MIUN A High-Level Overview of Cryptography 36

slide-82
SLIDE 82

Introduction Shared-key cryptography Public-key cryptography More counter-intuitive things References Key-exchange schemes

Definition (Diffie-Hellman key-exchange) Let g ∈ Z∗

p (publicly known, e.g. RFC, standard dots).

Alice generates random 0 < x < | Z∗

p |.

She send gx to Bob. Bob generates random 0 < y < | Z∗

p |.

He sends gy to Alice. Alice has x and g, gy. Bob has g, gx and y. They both compute gxy = (gy)x = (gx)y. Eve has g, gx, gy. By DHP she cannot compute gxy.

Daniel Bosk KTH/MIUN A High-Level Overview of Cryptography 36

slide-83
SLIDE 83

Introduction Shared-key cryptography Public-key cryptography More counter-intuitive things References Key-exchange schemes

Definition (Diffie-Hellman key-exchange) Let g ∈ Z∗

p (publicly known, e.g. RFC, standard dots).

Alice generates random 0 < x < | Z∗

p |.

She send gx to Bob. Bob generates random 0 < y < | Z∗

p |.

He sends gy to Alice. Alice has x and g, gy. Bob has g, gx and y. They both compute gxy = (gy)x = (gx)y. Eve has g, gx, gy. By DHP she cannot compute gxy.

Daniel Bosk KTH/MIUN A High-Level Overview of Cryptography 36

slide-84
SLIDE 84

Introduction Shared-key cryptography Public-key cryptography More counter-intuitive things References Key-exchange schemes

Definition (Diffie-Hellman key-exchange) Let g ∈ Z∗

p (publicly known, e.g. RFC, standard dots).

Alice generates random 0 < x < | Z∗

p |.

She send gx to Bob. Bob generates random 0 < y < | Z∗

p |.

He sends gy to Alice. Alice has x and g, gy. Bob has g, gx and y. They both compute gxy = (gy)x = (gx)y. Eve has g, gx, gy. By DHP she cannot compute gxy.

Daniel Bosk KTH/MIUN A High-Level Overview of Cryptography 36

slide-85
SLIDE 85

Introduction Shared-key cryptography Public-key cryptography More counter-intuitive things References Key-exchange schemes

Definition (Diffie-Hellman key-exchange) Let g ∈ Z∗

p (publicly known, e.g. RFC, standard dots).

Alice generates random 0 < x < | Z∗

p |.

She send gx to Bob. Bob generates random 0 < y < | Z∗

p |.

He sends gy to Alice. Alice has x and g, gy. Bob has g, gx and y. They both compute gxy = (gy)x = (gx)y. Eve has g, gx, gy. By DHP she cannot compute gxy.

Daniel Bosk KTH/MIUN A High-Level Overview of Cryptography 36

slide-86
SLIDE 86

Introduction Shared-key cryptography Public-key cryptography More counter-intuitive things References Encryption and decryption

Idea Fine, we can use gxy as a key in a cipher.

Encg xy (m), where Enc is a symmetric cipher.

But shouldn’t we be able to include a message directly?

Daniel Bosk KTH/MIUN A High-Level Overview of Cryptography 37

slide-87
SLIDE 87

Introduction Shared-key cryptography Public-key cryptography More counter-intuitive things References Encryption and decryption

Definition (ElGamal Encryption Scheme12) Set-up: Let g ∈ Z∗

p, randomly choose 0 < x < | Z∗ p |.

Alice publishes Z∗

p, g, gx to everyone.

Encryption: Bob chooses random 0 < y < | Z∗

p | and computes gy.

Bob’s message m ∈ Z∗

p.

He sends (gy, m(gx)y) to Alice. Decryption: Alice computes (gy)x and m(gx)y((gy)x)−1 = m.

12Taher ElGamal. ‘A Public Key Cryptosystem and a Signature Scheme

Based on Discrete Logarithms’. In: Advances in Cryptology: Proceedings of CRYPTO 84. Ed. by George Robert Blakley and David Chaum. Berlin, Heidelberg: Springer Berlin Heidelberg, 1985, pp. 10–18. ISBN: 978-3-540-39568-3. DOI: 10.1007/3-540-39568-7_2. URL:

Daniel Bosk KTH/MIUN A High-Level Overview of Cryptography 38

slide-88
SLIDE 88

Introduction Shared-key cryptography Public-key cryptography More counter-intuitive things References Digital signatures

Idea Sure, if Bob sends a message to Alice, he’s sure she’s the only

  • ne who can decrypt it.

Can’t we turn this around?

Can’t Alice use the same system to ensure Bob knows the message came from Alice?

Exercise Look at the ElGamal encryption scheme for a bit. Try to find a way to ‘run it backwards’.

Daniel Bosk KTH/MIUN A High-Level Overview of Cryptography 39

slide-89
SLIDE 89

Introduction Shared-key cryptography Public-key cryptography More counter-intuitive things References Digital signatures

Idea Sure, if Bob sends a message to Alice, he’s sure she’s the only

  • ne who can decrypt it.

Can’t we turn this around?

Can’t Alice use the same system to ensure Bob knows the message came from Alice?

Exercise Look at the ElGamal encryption scheme for a bit. Try to find a way to ‘run it backwards’.

Daniel Bosk KTH/MIUN A High-Level Overview of Cryptography 39

slide-90
SLIDE 90

Introduction Shared-key cryptography Public-key cryptography More counter-intuitive things References Digital signatures

Idea Sure, if Bob sends a message to Alice, he’s sure she’s the only

  • ne who can decrypt it.

Can’t we turn this around?

Can’t Alice use the same system to ensure Bob knows the message came from Alice?

Exercise Look at the ElGamal encryption scheme for a bit. Try to find a way to ‘run it backwards’.

Daniel Bosk KTH/MIUN A High-Level Overview of Cryptography 39

slide-91
SLIDE 91

Introduction Shared-key cryptography Public-key cryptography More counter-intuitive things References Digital signatures

Definition (ElGamal Signature Scheme13) Set-up: Let g ∈ Z∗

p and h be a one-way function .

Alice publishes Z∗

p, g, gx to everyone.

Signing m ∈ Z∗

p:

Alice chooses random 0 < y < | Z∗

p | and computes

r = gy ∈ Z∗

p.

She computes s = (h(m) − xr)y−1 (mod | Z∗

p |).

She sends (r, s) to Bob. Verification: Bob checks if gh(m) ? =Z∗

p (gx)rrs =Z∗ p

(gx)gy (gy)(h(m)−xgy)y−1 =Z∗

p gxgy+h(m)−xgy 13 Daniel Bosk KTH/MIUN A High-Level Overview of Cryptography 40

slide-92
SLIDE 92

Introduction Shared-key cryptography Public-key cryptography More counter-intuitive things References Digital signatures

Note It works without the hash. But then we can multiply two messages and still get a valid signature.

Daniel Bosk KTH/MIUN A High-Level Overview of Cryptography 41

slide-93
SLIDE 93

Introduction Shared-key cryptography Public-key cryptography More counter-intuitive things References Homomorphic properties

Definition (Homomorphism) A homomorphism is a map (function) that preserves structure between two algebraic structures. Example Let G1 = (R, ·) and G2 = (R, +) be groups. g1, g′

1 ∈ G1 and g2, g′ 2 ∈ G2.

Consider log: G1 → G2. log(g1 · g′

1) = g2 + g′ 2.

Daniel Bosk KTH/MIUN A High-Level Overview of Cryptography 42

slide-94
SLIDE 94

Introduction Shared-key cryptography Public-key cryptography More counter-intuitive things References Homomorphic properties

Definition (Homomorphism) A homomorphism is a map (function) that preserves structure between two algebraic structures. Example Let G1 = (R, ·) and G2 = (R, +) be groups. g1, g′

1 ∈ G1 and g2, g′ 2 ∈ G2.

Consider log: G1 → G2. log(g1 · g′

1) = g2 + g′ 2.

Daniel Bosk KTH/MIUN A High-Level Overview of Cryptography 42

slide-95
SLIDE 95

Introduction Shared-key cryptography Public-key cryptography More counter-intuitive things References Homomorphic properties

Definition (Homomorphism) A homomorphism is a map (function) that preserves structure between two algebraic structures. Example Let G1 = (R, ·) and G2 = (R, +) be groups. g1, g′

1 ∈ G1 and g2, g′ 2 ∈ G2.

Consider log: G1 → G2. log(g1 · g′

1) = g2 + g′ 2.

Daniel Bosk KTH/MIUN A High-Level Overview of Cryptography 42

slide-96
SLIDE 96

Introduction Shared-key cryptography Public-key cryptography More counter-intuitive things References Homomorphic properties

Definition (Homomorphism) A homomorphism is a map (function) that preserves structure between two algebraic structures. Example Let G1 = (R, ·) and G2 = (R, +) be groups. g1, g′

1 ∈ G1 and g2, g′ 2 ∈ G2.

Consider log: G1 → G2. log(g1 · g′

1) = g2 + g′ 2.

Daniel Bosk KTH/MIUN A High-Level Overview of Cryptography 42

slide-97
SLIDE 97

Introduction Shared-key cryptography Public-key cryptography More counter-intuitive things References Homomorphic properties

Exercise The encryption (decryption) function of the ElGamal cryptosystem is a homomorphism, what structure does it preserve?

Daniel Bosk KTH/MIUN A High-Level Overview of Cryptography 43

slide-98
SLIDE 98

Introduction Shared-key cryptography Public-key cryptography More counter-intuitive things References Homomorphic properties

Example (ElGamal’s homomorphism) Messages m, m′, ciphertexts (gy, m · gxy), (gy′, m′ · gxy′). Remember: private key x, hence the same. Create ciphertext (gygy′, m · gxy · m′ · gxy′) = (gy+y′, m · m′ · gxy+xy′) = (gy+y′, m · m′ · gx(y+y′)). Decryption: take gy+y′, compute (gy+y′)x = gx(y+y′). Decryption thus yields m · m′.

Daniel Bosk KTH/MIUN A High-Level Overview of Cryptography 44

slide-99
SLIDE 99

Introduction Shared-key cryptography Public-key cryptography More counter-intuitive things References Homomorphic properties

Example (ElGamal’s homomorphism) Messages m, m′, ciphertexts (gy, m · gxy), (gy′, m′ · gxy′). Remember: private key x, hence the same. Create ciphertext (gygy′, m · gxy · m′ · gxy′) = (gy+y′, m · m′ · gxy+xy′) = (gy+y′, m · m′ · gx(y+y′)). Decryption: take gy+y′, compute (gy+y′)x = gx(y+y′). Decryption thus yields m · m′.

Daniel Bosk KTH/MIUN A High-Level Overview of Cryptography 44

slide-100
SLIDE 100

Introduction Shared-key cryptography Public-key cryptography More counter-intuitive things References Homomorphic properties

Example (ElGamal’s homomorphism) Messages m, m′, ciphertexts (gy, m · gxy), (gy′, m′ · gxy′). Remember: private key x, hence the same. Create ciphertext (gygy′, m · gxy · m′ · gxy′) = (gy+y′, m · m′ · gxy+xy′) = (gy+y′, m · m′ · gx(y+y′)). Decryption: take gy+y′, compute (gy+y′)x = gx(y+y′). Decryption thus yields m · m′.

Daniel Bosk KTH/MIUN A High-Level Overview of Cryptography 44

slide-101
SLIDE 101

Introduction Shared-key cryptography Public-key cryptography More counter-intuitive things References Homomorphic properties

Note We use a hash function in the signature scheme to counter the homomorphic property. h(m) · h(m′) = h(m · m′). Without the hash function we could create a valid signature for a new message without knowing the signature key!

Daniel Bosk KTH/MIUN A High-Level Overview of Cryptography 45

slide-102
SLIDE 102

Introduction Shared-key cryptography Public-key cryptography More counter-intuitive things References Homomorphic properties

Note We use a hash function in the signature scheme to counter the homomorphic property. h(m) · h(m′) = h(m · m′). Without the hash function we could create a valid signature for a new message without knowing the signature key!

Daniel Bosk KTH/MIUN A High-Level Overview of Cryptography 45

slide-103
SLIDE 103

Introduction Shared-key cryptography Public-key cryptography More counter-intuitive things References Homomorphic properties

Note There are many schemes with different homomorphic properties. There is even fully homomorphic encryption [12].

Daniel Bosk KTH/MIUN A High-Level Overview of Cryptography 46

slide-104
SLIDE 104

Introduction Shared-key cryptography Public-key cryptography More counter-intuitive things References

1 Introduction

History Kerckhoff’s Principle Outline

2 Shared-key cryptography

Ciphers Security Hash functions Message-authentication codes

3 Public-key cryptography

Key-exchange schemes Encryption and decryption Digital signatures Homomorphic properties

4 More counter-intuitive things

Secure multi-party computation Zero-knowledge proofs of knowledge

Daniel Bosk KTH/MIUN A High-Level Overview of Cryptography 47

slide-105
SLIDE 105

Introduction Shared-key cryptography Public-key cryptography More counter-intuitive things References Secure multi-party computation

Example (Yao’s Millionaires’ Problem) Two millionaires meet in the street. They want to find out who is the richer. However, they don’t want to reveal how many millions they each have.

Daniel Bosk KTH/MIUN A High-Level Overview of Cryptography 48

slide-106
SLIDE 106

Introduction Shared-key cryptography Public-key cryptography More counter-intuitive things References Secure multi-party computation

Example (Yao’s Millionaires’ Problem) Two millionaires meet in the street. They want to find out who is the richer. However, they don’t want to reveal how many millions they each have.

Daniel Bosk KTH/MIUN A High-Level Overview of Cryptography 48

slide-107
SLIDE 107

Introduction Shared-key cryptography Public-key cryptography More counter-intuitive things References Secure multi-party computation

Idea We have n participants P1, . . . , Pn. Each person has a secret input value xj for 1 ≤ j ≤ n. But they desperately want to know y = f (x1, . . . , xn). P1 . . . Pn f f (x1, . . . , xn) = y

x1 xn

Daniel Bosk KTH/MIUN A High-Level Overview of Cryptography 49

slide-108
SLIDE 108

Introduction Shared-key cryptography Public-key cryptography More counter-intuitive things References Secure multi-party computation

Idea We have n participants P1, . . . , Pn. Each person has a secret input value xj for 1 ≤ j ≤ n. But they desperately want to know y = f (x1, . . . , xn). P1 . . . Pn f f (x1, . . . , xn) = y

x1 xn

Daniel Bosk KTH/MIUN A High-Level Overview of Cryptography 49

slide-109
SLIDE 109

Introduction Shared-key cryptography Public-key cryptography More counter-intuitive things References Secure multi-party computation

Idea We have n participants P1, . . . , Pn. Each person has a secret input value xj for 1 ≤ j ≤ n. But they desperately want to know y = f (x1, . . . , xn). P1 . . . Pn f f (x1, . . . , xn) = y

x1 xn

Daniel Bosk KTH/MIUN A High-Level Overview of Cryptography 49

slide-110
SLIDE 110

Introduction Shared-key cryptography Public-key cryptography More counter-intuitive things References Secure multi-party computation

Idea We have n participants P1, . . . , Pn. Each person has a secret input value xj for 1 ≤ j ≤ n. But they desperately want to know y = f (x1, . . . , xn). P1 . . . Pn f f (x1, . . . , xn) = y

x1 xn

Daniel Bosk KTH/MIUN A High-Level Overview of Cryptography 49

slide-111
SLIDE 111

Introduction Shared-key cryptography Public-key cryptography More counter-intuitive things References Secure multi-party computation

Example (Trivial solution) The n participants P1, . . . , Pn agree on a trusted third-party (TTP). Each participant give their secret to the TTP. The TTP trusted third-party performs the computation. Every participant receives the result from the TTP.

Daniel Bosk KTH/MIUN A High-Level Overview of Cryptography 50

slide-112
SLIDE 112

Introduction Shared-key cryptography Public-key cryptography More counter-intuitive things References Secure multi-party computation

Definition (Secure multiparty computation, MPC) n participants P1, . . . , Pn. n secret inputs x1, . . . , xn. A protocol π is executed by the participants. At the end of the protocol each participant learns y = f (x1, . . . , xn). The participants executing π should be equivalent to giving x1, . . . , xn to a TTP T who computes f (x1, . . . , xn) = y and returns y to each participant. Note Each participant Pi learns no more about xj (i = j) than what is revealed by y.

Daniel Bosk KTH/MIUN A High-Level Overview of Cryptography 51

slide-113
SLIDE 113

Introduction Shared-key cryptography Public-key cryptography More counter-intuitive things References Secure multi-party computation

Definition (Secure multiparty computation, MPC) n participants P1, . . . , Pn. n secret inputs x1, . . . , xn. A protocol π is executed by the participants. At the end of the protocol each participant learns y = f (x1, . . . , xn). The participants executing π should be equivalent to giving x1, . . . , xn to a TTP T who computes f (x1, . . . , xn) = y and returns y to each participant. Note Each participant Pi learns no more about xj (i = j) than what is revealed by y.

Daniel Bosk KTH/MIUN A High-Level Overview of Cryptography 51

slide-114
SLIDE 114

Introduction Shared-key cryptography Public-key cryptography More counter-intuitive things References Secure multi-party computation

Definition (Secure multiparty computation, MPC) n participants P1, . . . , Pn. n secret inputs x1, . . . , xn. A protocol π is executed by the participants. At the end of the protocol each participant learns y = f (x1, . . . , xn). The participants executing π should be equivalent to giving x1, . . . , xn to a TTP T who computes f (x1, . . . , xn) = y and returns y to each participant. Note Each participant Pi learns no more about xj (i = j) than what is revealed by y.

Daniel Bosk KTH/MIUN A High-Level Overview of Cryptography 51

slide-115
SLIDE 115

Introduction Shared-key cryptography Public-key cryptography More counter-intuitive things References Secure multi-party computation

Definition (Secure multiparty computation, MPC) n participants P1, . . . , Pn. n secret inputs x1, . . . , xn. A protocol π is executed by the participants. At the end of the protocol each participant learns y = f (x1, . . . , xn). The participants executing π should be equivalent to giving x1, . . . , xn to a TTP T who computes f (x1, . . . , xn) = y and returns y to each participant. Note Each participant Pi learns no more about xj (i = j) than what is revealed by y.

Daniel Bosk KTH/MIUN A High-Level Overview of Cryptography 51

slide-116
SLIDE 116

Introduction Shared-key cryptography Public-key cryptography More counter-intuitive things References Secure multi-party computation

In general this problem is solved. We can construct protocols for arbitrary functions f . Efficiency varies though. However, there are practically feasible protocols. Sometimes we can use homomorphisms. But we can construct rather complex functions too.

Daniel Bosk KTH/MIUN A High-Level Overview of Cryptography 52

slide-117
SLIDE 117

Introduction Shared-key cryptography Public-key cryptography More counter-intuitive things References Secure multi-party computation

In general this problem is solved. We can construct protocols for arbitrary functions f . Efficiency varies though. However, there are practically feasible protocols. Sometimes we can use homomorphisms. But we can construct rather complex functions too.

Daniel Bosk KTH/MIUN A High-Level Overview of Cryptography 52

slide-118
SLIDE 118

Introduction Shared-key cryptography Public-key cryptography More counter-intuitive things References Secure multi-party computation

In general this problem is solved. We can construct protocols for arbitrary functions f . Efficiency varies though. However, there are practically feasible protocols. Sometimes we can use homomorphisms. But we can construct rather complex functions too.

Daniel Bosk KTH/MIUN A High-Level Overview of Cryptography 52

slide-119
SLIDE 119

Introduction Shared-key cryptography Public-key cryptography More counter-intuitive things References Secure multi-party computation

Example (Sugar beet auctions14) Several thousand farmers produce sugar beets. These are sold to the monopoly Danisco, the sugar producer. Contracts are allocated via a nation-wide exchange, a double auction. A double auction contains multiple sellers and multiple buyers. The purpose is to find the market clearing price.

14Peter Bogetoft et al. ‘Secure Multiparty Computation Goes Live’. In:

Financial Cryptography and Data Security: FC 2009. Ed. by Roger Dingledine and Philippe Golle. Berlin, Heidelberg: Springer Berlin Heidelberg, 2009,

  • pp. 325–343. ISBN: 978-3-642-03549-4. DOI:

10.1007/978-3-642-03549-4_20. URL: http://dx.doi.org/10.1007/978-3-642-03549-4_20.

Daniel Bosk KTH/MIUN A High-Level Overview of Cryptography 53

slide-120
SLIDE 120

Introduction Shared-key cryptography Public-key cryptography More counter-intuitive things References Secure multi-party computation

Example (Sugar beet auctions14) Several thousand farmers produce sugar beets. These are sold to the monopoly Danisco, the sugar producer. Contracts are allocated via a nation-wide exchange, a double auction. A double auction contains multiple sellers and multiple buyers. The purpose is to find the market clearing price.

14Peter Bogetoft et al. ‘Secure Multiparty Computation Goes Live’. In:

Financial Cryptography and Data Security: FC 2009. Ed. by Roger Dingledine and Philippe Golle. Berlin, Heidelberg: Springer Berlin Heidelberg, 2009,

  • pp. 325–343. ISBN: 978-3-642-03549-4. DOI:

10.1007/978-3-642-03549-4_20. URL: http://dx.doi.org/10.1007/978-3-642-03549-4_20.

Daniel Bosk KTH/MIUN A High-Level Overview of Cryptography 53

slide-121
SLIDE 121

Introduction Shared-key cryptography Public-key cryptography More counter-intuitive things References Secure multi-party computation

Example (Sugar beet auctions, continued) Each buyer places a bid specifying how much he is willing to buy at each potential price. Each seller says how much they are willing to sell at each given price. The auctioneer computes the total supply and demand for each price. We want to find where supply equals demand. When done, anyone who specified non-zero for this price may trade at this price.

Daniel Bosk KTH/MIUN A High-Level Overview of Cryptography 54

slide-122
SLIDE 122

Introduction Shared-key cryptography Public-key cryptography More counter-intuitive things References Secure multi-party computation

Example (Sugar beet auctions, continued) Each buyer places a bid specifying how much he is willing to buy at each potential price. Each seller says how much they are willing to sell at each given price. The auctioneer computes the total supply and demand for each price. We want to find where supply equals demand. When done, anyone who specified non-zero for this price may trade at this price.

Daniel Bosk KTH/MIUN A High-Level Overview of Cryptography 54

slide-123
SLIDE 123

Introduction Shared-key cryptography Public-key cryptography More counter-intuitive things References Secure multi-party computation

Example (Sugar beet auctions, continued) Each buyer places a bid specifying how much he is willing to buy at each potential price. Each seller says how much they are willing to sell at each given price. The auctioneer computes the total supply and demand for each price. We want to find where supply equals demand. When done, anyone who specified non-zero for this price may trade at this price.

Daniel Bosk KTH/MIUN A High-Level Overview of Cryptography 54

slide-124
SLIDE 124

Introduction Shared-key cryptography Public-key cryptography More counter-intuitive things References Zero-knowledge proofs of knowledge

Example Alice must prove her identity to Eve. Eve has Alice’s public key, and knows it belongs to Alice. Alice wants to prove she is the owner of the private key belonging to the public key that Eve has. Eve asks Alice to sign the message m, if the signature verifies under the public key Eve believes Alice. Gaaahh! Now Eve can show this message (chosen by Eve) with Alice’s signature on it! What if Eve’s chosen message was ‘I give all my money to Eve’?

Daniel Bosk KTH/MIUN A High-Level Overview of Cryptography 55

slide-125
SLIDE 125

Introduction Shared-key cryptography Public-key cryptography More counter-intuitive things References Zero-knowledge proofs of knowledge

Example Alice must prove her identity to Eve. Eve has Alice’s public key, and knows it belongs to Alice. Alice wants to prove she is the owner of the private key belonging to the public key that Eve has. Eve asks Alice to sign the message m, if the signature verifies under the public key Eve believes Alice. Gaaahh! Now Eve can show this message (chosen by Eve) with Alice’s signature on it! What if Eve’s chosen message was ‘I give all my money to Eve’?

Daniel Bosk KTH/MIUN A High-Level Overview of Cryptography 55

slide-126
SLIDE 126

Introduction Shared-key cryptography Public-key cryptography More counter-intuitive things References Zero-knowledge proofs of knowledge

Example Alice must prove her identity to Eve. Eve has Alice’s public key, and knows it belongs to Alice. Alice wants to prove she is the owner of the private key belonging to the public key that Eve has. Eve asks Alice to sign the message m, if the signature verifies under the public key Eve believes Alice. Gaaahh! Now Eve can show this message (chosen by Eve) with Alice’s signature on it! What if Eve’s chosen message was ‘I give all my money to Eve’?

Daniel Bosk KTH/MIUN A High-Level Overview of Cryptography 55

slide-127
SLIDE 127

Introduction Shared-key cryptography Public-key cryptography More counter-intuitive things References Zero-knowledge proofs of knowledge

Example Alice must prove her identity to Eve. Eve has Alice’s public key, and knows it belongs to Alice. Alice wants to prove she is the owner of the private key belonging to the public key that Eve has. Eve asks Alice to sign the message m, if the signature verifies under the public key Eve believes Alice. Gaaahh! Now Eve can show this message (chosen by Eve) with Alice’s signature on it! What if Eve’s chosen message was ‘I give all my money to Eve’?

Daniel Bosk KTH/MIUN A High-Level Overview of Cryptography 55

slide-128
SLIDE 128

Introduction Shared-key cryptography Public-key cryptography More counter-intuitive things References Zero-knowledge proofs of knowledge

Idea Alice wants to prove that she knows the discrete logarithm x

  • f a value gx.

She will do this without revealing x to Eve.

Daniel Bosk KTH/MIUN A High-Level Overview of Cryptography 56

slide-129
SLIDE 129

Introduction Shared-key cryptography Public-key cryptography More counter-intuitive things References Zero-knowledge proofs of knowledge

Definition (Schnorr’s protocol15) Prover wants to prove knowledge of x for gx = y. Prover commits to randomness r, by sending t = gr. Verifier replies with randomly chosen challenge c. After receiving c, prover replies with s = r + cx. Verifier accepts if gs = gr+cx = gr(gx)c = tyc.

  • 15C. P. Schnorr. ‘Efficient signature generation by smart cards’. In: Journal
  • f Cryptology 4.3 (1991), pp. 161–174. ISSN: 1432-1378. DOI:

10.1007/BF00196725. URL: http://dx.doi.org/10.1007/BF00196725.

Daniel Bosk KTH/MIUN A High-Level Overview of Cryptography 57

slide-130
SLIDE 130

Introduction Shared-key cryptography Public-key cryptography More counter-intuitive things References Zero-knowledge proofs of knowledge

Definition (Schnorr’s protocol15) Prover wants to prove knowledge of x for gx = y. Prover commits to randomness r, by sending t = gr. Verifier replies with randomly chosen challenge c. After receiving c, prover replies with s = r + cx. Verifier accepts if gs = gr+cx = gr(gx)c = tyc.

  • 15C. P. Schnorr. ‘Efficient signature generation by smart cards’. In: Journal
  • f Cryptology 4.3 (1991), pp. 161–174. ISSN: 1432-1378. DOI:

10.1007/BF00196725. URL: http://dx.doi.org/10.1007/BF00196725.

Daniel Bosk KTH/MIUN A High-Level Overview of Cryptography 57

slide-131
SLIDE 131

Introduction Shared-key cryptography Public-key cryptography More counter-intuitive things References Zero-knowledge proofs of knowledge

Definition (Schnorr’s protocol15) Prover wants to prove knowledge of x for gx = y. Prover commits to randomness r, by sending t = gr. Verifier replies with randomly chosen challenge c. After receiving c, prover replies with s = r + cx. Verifier accepts if gs = gr+cx = gr(gx)c = tyc.

  • 15C. P. Schnorr. ‘Efficient signature generation by smart cards’. In: Journal
  • f Cryptology 4.3 (1991), pp. 161–174. ISSN: 1432-1378. DOI:

10.1007/BF00196725. URL: http://dx.doi.org/10.1007/BF00196725.

Daniel Bosk KTH/MIUN A High-Level Overview of Cryptography 57

slide-132
SLIDE 132

Introduction Shared-key cryptography Public-key cryptography More counter-intuitive things References Zero-knowledge proofs of knowledge

Definition (Schnorr’s protocol15) Prover wants to prove knowledge of x for gx = y. Prover commits to randomness r, by sending t = gr. Verifier replies with randomly chosen challenge c. After receiving c, prover replies with s = r + cx. Verifier accepts if gs = gr+cx = gr(gx)c = tyc.

  • 15C. P. Schnorr. ‘Efficient signature generation by smart cards’. In: Journal
  • f Cryptology 4.3 (1991), pp. 161–174. ISSN: 1432-1378. DOI:

10.1007/BF00196725. URL: http://dx.doi.org/10.1007/BF00196725.

Daniel Bosk KTH/MIUN A High-Level Overview of Cryptography 57

slide-133
SLIDE 133

Introduction Shared-key cryptography Public-key cryptography More counter-intuitive things References Zero-knowledge proofs of knowledge

Definition (Schnorr’s protocol15) Prover wants to prove knowledge of x for gx = y. Prover commits to randomness r, by sending t = gr. Verifier replies with randomly chosen challenge c. After receiving c, prover replies with s = r + cx. Verifier accepts if gs = gr+cx = gr(gx)c = tyc.

  • 15C. P. Schnorr. ‘Efficient signature generation by smart cards’. In: Journal
  • f Cryptology 4.3 (1991), pp. 161–174. ISSN: 1432-1378. DOI:

10.1007/BF00196725. URL: http://dx.doi.org/10.1007/BF00196725.

Daniel Bosk KTH/MIUN A High-Level Overview of Cryptography 57

slide-134
SLIDE 134

Introduction Shared-key cryptography Public-key cryptography More counter-intuitive things References Zero-knowledge proofs of knowledge

Proof outline. We need to prove completeness: for all (most) statements the verifier will accept. We need to prove soundness: for all (most) false statements the verifier will reject. We need to prove that it is zero-knowledge.

Daniel Bosk KTH/MIUN A High-Level Overview of Cryptography 58

slide-135
SLIDE 135

Introduction Shared-key cryptography Public-key cryptography More counter-intuitive things References Zero-knowledge proofs of knowledge

Proof outline. We need to prove completeness: for all (most) statements the verifier will accept. We need to prove soundness: for all (most) false statements the verifier will reject. We need to prove that it is zero-knowledge.

Daniel Bosk KTH/MIUN A High-Level Overview of Cryptography 58

slide-136
SLIDE 136

Introduction Shared-key cryptography Public-key cryptography More counter-intuitive things References Zero-knowledge proofs of knowledge

Proof outline. We need to prove completeness: for all (most) statements the verifier will accept. We need to prove soundness: for all (most) false statements the verifier will reject. We need to prove that it is zero-knowledge.

Daniel Bosk KTH/MIUN A High-Level Overview of Cryptography 58

slide-137
SLIDE 137

Introduction Shared-key cryptography Public-key cryptography More counter-intuitive things References Zero-knowledge proofs of knowledge

Zero-knowledge Transcript for protocol: (t, c, s). Probability for transcript occurring:

1 |R| · 1 deg g .

Simulate protocol: randomly choose c, randomly choose s, compute t by gsyc. We see that we get the same probability distribution. Thus the simulated transcripts are indistinguishable from the real ones.

Daniel Bosk KTH/MIUN A High-Level Overview of Cryptography 59

slide-138
SLIDE 138

Introduction Shared-key cryptography Public-key cryptography More counter-intuitive things References Zero-knowledge proofs of knowledge

Zero-knowledge Transcript for protocol: (t, c, s). Probability for transcript occurring:

1 |R| · 1 deg g .

Simulate protocol: randomly choose c, randomly choose s, compute t by gsyc. We see that we get the same probability distribution. Thus the simulated transcripts are indistinguishable from the real ones.

Daniel Bosk KTH/MIUN A High-Level Overview of Cryptography 59

slide-139
SLIDE 139

Introduction Shared-key cryptography Public-key cryptography More counter-intuitive things References Zero-knowledge proofs of knowledge

Zero-knowledge Transcript for protocol: (t, c, s). Probability for transcript occurring:

1 |R| · 1 deg g .

Simulate protocol: randomly choose c, randomly choose s, compute t by gsyc. We see that we get the same probability distribution. Thus the simulated transcripts are indistinguishable from the real ones.

Daniel Bosk KTH/MIUN A High-Level Overview of Cryptography 59

slide-140
SLIDE 140

Introduction Shared-key cryptography Public-key cryptography More counter-intuitive things References Zero-knowledge proofs of knowledge

[1] ‘cryptography, n.’. In: OED Online. Hämtad den 5 april 2013. Oxford University Press, Mar. 2013. URL: http://www.oed.com/view/Entry/45374? redirectedFrom=cryptography&. [2] ‘crypto-, comb. form’. In: OED Online. Hämtad den 5 april

  • 2013. Oxford University Press, Mar. 2013. URL:

http://www.oed.com/view/Entry/45363. [3] ‘graphy-, comb. form’. In: OED Online. Hämtad den 5 april

  • 2013. Oxford University Press, Mar. 2013. URL:

http://www.oed.com/view/Entry/80855. [4] Auguste Kerckhoff. ‘La cryptographie militaire’. In: Journal des sciences militaires 9 (1883), pp. 5–38, 161–191.

Daniel Bosk KTH/MIUN A High-Level Overview of Cryptography 60

slide-141
SLIDE 141

Introduction Shared-key cryptography Public-key cryptography More counter-intuitive things References Zero-knowledge proofs of knowledge

[5] Douglas R. Stinson. Cryptography: Theory and Practice. 3rd ed. Boca Raton: Chapman & Hall/CRC, 2006. ISBN: 1-58488-508-4 (Hardcover). [6] Claude E Shannon. ‘Communication theory of secrecy systems’. In: Bell system technical journal 28.4 (1949),

  • pp. 656–715.

[7] Jonathan Katz and Yehuda Lindell. Introduction to modern

  • cryptography. 1st ed. Boca Raton: Chapman & Hall/CRC,
  • 2008. ISBN: 9781584885511.

[8] Oded Goldreich. Foundations of cryptography, Vol. 1: Basic

  • tools. Cambridge: Cambridge Univ. Press, 2001. ISBN:

0-521-79172-3.

Daniel Bosk KTH/MIUN A High-Level Overview of Cryptography 61

slide-142
SLIDE 142

Introduction Shared-key cryptography Public-key cryptography More counter-intuitive things References Zero-knowledge proofs of knowledge

[9] Mihir Bellare, Ran Canetti and Hugo Krawczyk. ‘Keying Hash Functions for Message Authentication’. In: Advances in Cryptology — CRYPTO ’96: Prooceedings of the 16th Annual International Cryptology Conference. Ed. by Neal Koblitz. Berlin, Heidelberg: Springer Berlin Heidelberg, 1996, pp. 1–15. ISBN: 978-3-540-68697-2. DOI: 10.1007/3-540-68697-5_1. URL: http://dx.doi.org/10.1007/3-540-68697-5_1. [10] Whitfield Diffie and Martin E Hellman. ‘New directions in cryptography’. In: IEEE Transactions on Information Theory 22.6 (1976), pp. 644–654.

Daniel Bosk KTH/MIUN A High-Level Overview of Cryptography 62

slide-143
SLIDE 143

Introduction Shared-key cryptography Public-key cryptography More counter-intuitive things References Zero-knowledge proofs of knowledge

[11] Taher ElGamal. ‘A Public Key Cryptosystem and a Signature Scheme Based on Discrete Logarithms’. In: Advances in Cryptology: Proceedings of CRYPTO 84. Ed. by George Robert Blakley and David Chaum. Berlin, Heidelberg: Springer Berlin Heidelberg, 1985, pp. 10–18. ISBN: 978-3-540-39568-3. DOI: 10.1007/3-540-39568-7_2. URL: http://dx.doi.org/10.1007/3-540-39568-7_2. [12] Craig Gentry. ‘A fully homomorphic encryption scheme’. PhD thesis. Stanford University, 2009. URL: https: //crypto.stanford.edu/craig/craig-thesis.pdf.

Daniel Bosk KTH/MIUN A High-Level Overview of Cryptography 63

slide-144
SLIDE 144

Introduction Shared-key cryptography Public-key cryptography More counter-intuitive things References Zero-knowledge proofs of knowledge

[13] Peter Bogetoft, Dan Lund Christensen, Ivan Damgård, Martin Geisler, Thomas Jakobsen, Mikkel Krøigaard, Janus Dam Nielsen, Jesper Buus Nielsen, Kurt Nielsen, Jakob Pagter, Michael Schwartzbach and Tomas Toft. ‘Secure Multiparty Computation Goes Live’. In: Financial Cryptography and Data Security: FC 2009. Ed. by Roger Dingledine and Philippe Golle. Berlin, Heidelberg: Springer Berlin Heidelberg, 2009, pp. 325–343. ISBN: 978-3-642-03549-4. DOI: 10.1007/978-3-642-03549-4_20. URL: http://dx.doi.org/10.1007/978-3-642-03549-4_20.

Daniel Bosk KTH/MIUN A High-Level Overview of Cryptography 64

slide-145
SLIDE 145

Introduction Shared-key cryptography Public-key cryptography More counter-intuitive things References Zero-knowledge proofs of knowledge

[14]

  • C. P. Schnorr. ‘Efficient signature generation by smart cards’.

In: Journal of Cryptology 4.3 (1991), pp. 161–174. ISSN: 1432-1378. DOI: 10.1007/BF00196725. URL: http://dx.doi.org/10.1007/BF00196725.

Daniel Bosk KTH/MIUN A High-Level Overview of Cryptography 65