1 RANDOM GRAPHS IN CRYPTOGRAPHY Adi Shamir The Weizmann Institute Israel May 15, 2007 7th Haifa...

141
1 RANDOM GRAPHS IN CRYPTOGRAPHY Adi Shamir The Weizmann Institute Israel May 15, 2007 7th Haifa Workshop on Interdisciplina ry Applications of Graph Theory, Combinatorics and Algorithms
  • date post

    21-Dec-2015
  • Category

    Documents

  • view

    213
  • download

    0

Transcript of 1 RANDOM GRAPHS IN CRYPTOGRAPHY Adi Shamir The Weizmann Institute Israel May 15, 2007 7th Haifa...

Page 1: 1 RANDOM GRAPHS IN CRYPTOGRAPHY Adi Shamir The Weizmann Institute Israel May 15, 2007 7th Haifa Workshop on Interdisciplinary Applications of Graph Theory,

1

RANDOM GRAPHS IN CRYPTOGRAPHY

Adi ShamirThe Weizmann Institute

Israel

May 15, 2007 7th Haifa Workshop on Interdisciplinary Applications of Graph Theory,

Combinatorics and Algorithms

Page 2: 1 RANDOM GRAPHS IN CRYPTOGRAPHY Adi Shamir The Weizmann Institute Israel May 15, 2007 7th Haifa Workshop on Interdisciplinary Applications of Graph Theory,

2

Random Graphs in Cryptography:

In this talk I will concentrate on some particular algorithmic issues related to random graphs which are motivated by cryptanalytic applications

Many of the results I will describe are either unpublished or little known in our community

Note that in cryptanalysis, constants are important!

Page 3: 1 RANDOM GRAPHS IN CRYPTOGRAPHY Adi Shamir The Weizmann Institute Israel May 15, 2007 7th Haifa Workshop on Interdisciplinary Applications of Graph Theory,

3

Cryptography and Randomness:

Cryptography deals with many types of randomness:

- random strings- random variables- random functions- random permutations- random walks- …

Page 4: 1 RANDOM GRAPHS IN CRYPTOGRAPHY Adi Shamir The Weizmann Institute Israel May 15, 2007 7th Haifa Workshop on Interdisciplinary Applications of Graph Theory,

4

Cryptography and Randomness:

The notion of random functions (oracles):

- truly random when applied to fresh inputs- consistent when applied to previously used inputs

f(0)=37f(1)=92f(2)=78f(3)=51

Page 5: 1 RANDOM GRAPHS IN CRYPTOGRAPHY Adi Shamir The Weizmann Institute Israel May 15, 2007 7th Haifa Workshop on Interdisciplinary Applications of Graph Theory,

5

Cryptography and Randomness:

This tabular description gives us a local view, which is not very informative

To see the big picture, we define the random graph G associated with the random function f:

x f(x)

Page 6: 1 RANDOM GRAPHS IN CRYPTOGRAPHY Adi Shamir The Weizmann Institute Israel May 15, 2007 7th Haifa Workshop on Interdisciplinary Applications of Graph Theory,

6

Cryptography and Randomness:

When the function f is a permutation, its associated graph G is very simple:

Page 7: 1 RANDOM GRAPHS IN CRYPTOGRAPHY Adi Shamir The Weizmann Institute Israel May 15, 2007 7th Haifa Workshop on Interdisciplinary Applications of Graph Theory,

7

Cryptography and Randomness:

However, when the function f is a random function rather than a random permutation, we get a very rich and interesting structure:

Page 8: 1 RANDOM GRAPHS IN CRYPTOGRAPHY Adi Shamir The Weizmann Institute Israel May 15, 2007 7th Haifa Workshop on Interdisciplinary Applications of Graph Theory,

8

Random Graph #1:

Page 9: 1 RANDOM GRAPHS IN CRYPTOGRAPHY Adi Shamir The Weizmann Institute Israel May 15, 2007 7th Haifa Workshop on Interdisciplinary Applications of Graph Theory,

9

Random Graph #2:

Page 10: 1 RANDOM GRAPHS IN CRYPTOGRAPHY Adi Shamir The Weizmann Institute Israel May 15, 2007 7th Haifa Workshop on Interdisciplinary Applications of Graph Theory,

10

Cryptography and Randomness:

There is a huge literature on the structure and combinatorial properties of such random graphs:

The distribution of component sizes, tree sizes, cycle sizes, vertex in-degrees, number of predecessors, etc.

Page 11: 1 RANDOM GRAPHS IN CRYPTOGRAPHY Adi Shamir The Weizmann Institute Israel May 15, 2007 7th Haifa Workshop on Interdisciplinary Applications of Graph Theory,

11

Cryptography and Randomness:

In many applications we are interesting in the behavior of the random function f under iteration.

Examples:- pseudo random generators- stream ciphers- iterated block ciphers and hash functions- time/memory tradeoff attacks - randomized iterates- …

In this case, we are interested in a single path starting at a random vertex within the random graph.

Page 12: 1 RANDOM GRAPHS IN CRYPTOGRAPHY Adi Shamir The Weizmann Institute Israel May 15, 2007 7th Haifa Workshop on Interdisciplinary Applications of Graph Theory,

12

A random path in a random graph:

Page 13: 1 RANDOM GRAPHS IN CRYPTOGRAPHY Adi Shamir The Weizmann Institute Israel May 15, 2007 7th Haifa Workshop on Interdisciplinary Applications of Graph Theory,

13

A random path in a random graph:

Page 14: 1 RANDOM GRAPHS IN CRYPTOGRAPHY Adi Shamir The Weizmann Institute Israel May 15, 2007 7th Haifa Workshop on Interdisciplinary Applications of Graph Theory,

14

A random path in a random graph:

Page 15: 1 RANDOM GRAPHS IN CRYPTOGRAPHY Adi Shamir The Weizmann Institute Israel May 15, 2007 7th Haifa Workshop on Interdisciplinary Applications of Graph Theory,

15

Cryptography and Randomness:

Such a path always starts with a tail, and ends with a cycle.

The expected length of both the tail and the cycle is about the square root of the number of vertices.

Page 16: 1 RANDOM GRAPHS IN CRYPTOGRAPHY Adi Shamir The Weizmann Institute Israel May 15, 2007 7th Haifa Workshop on Interdisciplinary Applications of Graph Theory,

16

Interesting algorithmic problems on paths:

Assuming that we can only move forwards along edges:

Page 17: 1 RANDOM GRAPHS IN CRYPTOGRAPHY Adi Shamir The Weizmann Institute Israel May 15, 2007 7th Haifa Workshop on Interdisciplinary Applications of Graph Theory,

17

Interesting algorithmic problems on paths:

Assuming that we can only move forwards along edges:

- Find some point on the cycle

Page 18: 1 RANDOM GRAPHS IN CRYPTOGRAPHY Adi Shamir The Weizmann Institute Israel May 15, 2007 7th Haifa Workshop on Interdisciplinary Applications of Graph Theory,

18

Interesting algorithmic problems on paths:

Assuming that we can only move forwards along edges:

- Find some point on the cycle- Find the same point a second time

Page 19: 1 RANDOM GRAPHS IN CRYPTOGRAPHY Adi Shamir The Weizmann Institute Israel May 15, 2007 7th Haifa Workshop on Interdisciplinary Applications of Graph Theory,

19

Interesting algorithmic problems on paths:

Assuming that we can only move forwards along edges:

- Find some point on the cycle- Find the same point a second time- Find the length of the cycle

l

Page 20: 1 RANDOM GRAPHS IN CRYPTOGRAPHY Adi Shamir The Weizmann Institute Israel May 15, 2007 7th Haifa Workshop on Interdisciplinary Applications of Graph Theory,

20

Interesting algorithmic problems on paths:

Assuming that we can only move forwards along edges:

- Find some point on the cycle- Find the same point a second time- Find the length of the cycle- Find the cycle entry point

Page 21: 1 RANDOM GRAPHS IN CRYPTOGRAPHY Adi Shamir The Weizmann Institute Israel May 15, 2007 7th Haifa Workshop on Interdisciplinary Applications of Graph Theory,

21

Interesting algorithmic problems on paths:

Why are we interested in these algorithms?

- Pollard’s rho algorithm: The cycle length l can be used to find small factors of large numbers, requires only negligible memory. - Finding collisions in hash functions: The cycle entry point can represent a hash function collision.

Page 22: 1 RANDOM GRAPHS IN CRYPTOGRAPHY Adi Shamir The Weizmann Institute Israel May 15, 2007 7th Haifa Workshop on Interdisciplinary Applications of Graph Theory,

22

How to find a collision in a given hash function H?

- Exhaustive search: Requires 2n time, no space- Birthday paradox: Construct a large table of 2n/2 random hash values, sort it, and look for consecutive equal values. Requires both time and space of 2n/2

- Random path algorithm: Iterate the hash function until you find the entry point into a cycle. Requires 2n/2 time and very little space

Page 23: 1 RANDOM GRAPHS IN CRYPTOGRAPHY Adi Shamir The Weizmann Institute Israel May 15, 2007 7th Haifa Workshop on Interdisciplinary Applications of Graph Theory,

23

Cycle detection is a very well studied problem:

- Floyd- Pollard- Brent- Yao- Quisquater- …

And yet there are new surprising ideas!

Page 24: 1 RANDOM GRAPHS IN CRYPTOGRAPHY Adi Shamir The Weizmann Institute Israel May 15, 2007 7th Haifa Workshop on Interdisciplinary Applications of Graph Theory,

24

The best known technique:Floyd’s two finger algorithm:- Keep two pointers- Run one of them at normal speed, and the other at double speed, until they collide

Page 25: 1 RANDOM GRAPHS IN CRYPTOGRAPHY Adi Shamir The Weizmann Institute Israel May 15, 2007 7th Haifa Workshop on Interdisciplinary Applications of Graph Theory,

25

Floyd’s two finger algorithm:- Keep two pointers- Run one of them at normal speed, and the other at double speed, until they collide

Page 26: 1 RANDOM GRAPHS IN CRYPTOGRAPHY Adi Shamir The Weizmann Institute Israel May 15, 2007 7th Haifa Workshop on Interdisciplinary Applications of Graph Theory,

26

Floyd’s two finger algorithm:- Keep two pointers- Run one of them at normal speed, and the other at double speed, until they collide

Page 27: 1 RANDOM GRAPHS IN CRYPTOGRAPHY Adi Shamir The Weizmann Institute Israel May 15, 2007 7th Haifa Workshop on Interdisciplinary Applications of Graph Theory,

27

Floyd’s two finger algorithm:- Keep two pointers- Run one of them at normal speed, and the other at double speed, until they collide

Page 28: 1 RANDOM GRAPHS IN CRYPTOGRAPHY Adi Shamir The Weizmann Institute Israel May 15, 2007 7th Haifa Workshop on Interdisciplinary Applications of Graph Theory,

28

Floyd’s two finger algorithm:- Keep two pointers- Run one of them at normal speed, and the other at double speed, until they collide

Page 29: 1 RANDOM GRAPHS IN CRYPTOGRAPHY Adi Shamir The Weizmann Institute Israel May 15, 2007 7th Haifa Workshop on Interdisciplinary Applications of Graph Theory,

29

Floyd’s two finger algorithm:- Keep two pointers- Run one of them at normal speed, and the other at double speed, until they collide

Page 30: 1 RANDOM GRAPHS IN CRYPTOGRAPHY Adi Shamir The Weizmann Institute Israel May 15, 2007 7th Haifa Workshop on Interdisciplinary Applications of Graph Theory,

30

Floyd’s two finger algorithm:- Keep two pointers- Run one of them at normal speed, and the other at double speed, until they collide

Page 31: 1 RANDOM GRAPHS IN CRYPTOGRAPHY Adi Shamir The Weizmann Institute Israel May 15, 2007 7th Haifa Workshop on Interdisciplinary Applications of Graph Theory,

31

Floyd’s two finger algorithm:- Keep two pointers- Run one of them at normal speed, and the other at double speed, until they collide

Page 32: 1 RANDOM GRAPHS IN CRYPTOGRAPHY Adi Shamir The Weizmann Institute Israel May 15, 2007 7th Haifa Workshop on Interdisciplinary Applications of Graph Theory,

32

Floyd’s two finger algorithm:- Keep two pointers- Run one of them at normal speed, and the other at double speed, until they collide

Page 33: 1 RANDOM GRAPHS IN CRYPTOGRAPHY Adi Shamir The Weizmann Institute Israel May 15, 2007 7th Haifa Workshop on Interdisciplinary Applications of Graph Theory,

33

Floyd’s two finger algorithm:- Keep two pointers- Run one of them at normal speed, and the other at double speed, until they collide

Page 34: 1 RANDOM GRAPHS IN CRYPTOGRAPHY Adi Shamir The Weizmann Institute Israel May 15, 2007 7th Haifa Workshop on Interdisciplinary Applications of Graph Theory,

34

Can we use Floyd’s algorithm to find the entry point into the cycle?

Page 35: 1 RANDOM GRAPHS IN CRYPTOGRAPHY Adi Shamir The Weizmann Institute Israel May 15, 2007 7th Haifa Workshop on Interdisciplinary Applications of Graph Theory,

35

Can we use Floyd’s algorithm to find the entry point into the cycle?-First find the meeting point

Page 36: 1 RANDOM GRAPHS IN CRYPTOGRAPHY Adi Shamir The Weizmann Institute Israel May 15, 2007 7th Haifa Workshop on Interdisciplinary Applications of Graph Theory,

36

Can we use Floyd’s algorithm to find the entry point into the cycle?- first find the meeting point- move one of the fingers back to the beginning

Page 37: 1 RANDOM GRAPHS IN CRYPTOGRAPHY Adi Shamir The Weizmann Institute Israel May 15, 2007 7th Haifa Workshop on Interdisciplinary Applications of Graph Theory,

37

Can we use Floyd’s algorithm to find the entry point into the cycle?- first find the meeting point- move one of the fingers back to the beginning- move the two fingers at equal speed

Page 38: 1 RANDOM GRAPHS IN CRYPTOGRAPHY Adi Shamir The Weizmann Institute Israel May 15, 2007 7th Haifa Workshop on Interdisciplinary Applications of Graph Theory,

38

Can we use Floyd’s algorithm to find the entry point into the cycle?- first find the meeting point- move one of the fingers back to the beginning- move the two fingers at equal speed

Page 39: 1 RANDOM GRAPHS IN CRYPTOGRAPHY Adi Shamir The Weizmann Institute Israel May 15, 2007 7th Haifa Workshop on Interdisciplinary Applications of Graph Theory,

39

Can we use Floyd’s algorithm to find the entry point into the cycle?- first find the meeting point- move one of the fingers back to the beginning- move the two fingers at equal speed

Page 40: 1 RANDOM GRAPHS IN CRYPTOGRAPHY Adi Shamir The Weizmann Institute Israel May 15, 2007 7th Haifa Workshop on Interdisciplinary Applications of Graph Theory,

40

Why does it work?

Page 41: 1 RANDOM GRAPHS IN CRYPTOGRAPHY Adi Shamir The Weizmann Institute Israel May 15, 2007 7th Haifa Workshop on Interdisciplinary Applications of Graph Theory,

41

Why does it work?- denote by d the distance from the beginningto the meeting point

d

Page 42: 1 RANDOM GRAPHS IN CRYPTOGRAPHY Adi Shamir The Weizmann Institute Israel May 15, 2007 7th Haifa Workshop on Interdisciplinary Applications of Graph Theory,

42

Why does it work?- denote by d the distance from the beginningto the meeting point- the fast finger ran another d, reaching the same point, so d is some (unknown) multiple of the cycle length

d

Page 43: 1 RANDOM GRAPHS IN CRYPTOGRAPHY Adi Shamir The Weizmann Institute Israel May 15, 2007 7th Haifa Workshop on Interdisciplinary Applications of Graph Theory,

43

Why does it work?- running the two marked fingers another d steps reaches the same point again

d

Page 44: 1 RANDOM GRAPHS IN CRYPTOGRAPHY Adi Shamir The Weizmann Institute Israel May 15, 2007 7th Haifa Workshop on Interdisciplinary Applications of Graph Theory,

44

Why does it work?- running the two marked fingers another d steps reaches the same point again- so the two fingers meet for the first time at the entrance to the cycle, and then travel together

d

Page 45: 1 RANDOM GRAPHS IN CRYPTOGRAPHY Adi Shamir The Weizmann Institute Israel May 15, 2007 7th Haifa Workshop on Interdisciplinary Applications of Graph Theory,

45

Why does it work?- running the two marked fingers another d steps reaches the same point again- so the two fingers meet for the first time at the entrance to the cycle, and then travel together

d

Page 46: 1 RANDOM GRAPHS IN CRYPTOGRAPHY Adi Shamir The Weizmann Institute Israel May 15, 2007 7th Haifa Workshop on Interdisciplinary Applications of Graph Theory,

46

Is this the most efficient cycle detection algorithm?

Page 47: 1 RANDOM GRAPHS IN CRYPTOGRAPHY Adi Shamir The Weizmann Institute Israel May 15, 2007 7th Haifa Workshop on Interdisciplinary Applications of Graph Theory,

47

Is this the most efficient cycle detection algorithm?

- When the path has n vertices and the tail is short, Floyd’s algorithm requires about 3n steps, and its extension requires up to 5n steps

Page 48: 1 RANDOM GRAPHS IN CRYPTOGRAPHY Adi Shamir The Weizmann Institute Israel May 15, 2007 7th Haifa Workshop on Interdisciplinary Applications of Graph Theory,

48

Is this the most efficient cycle detection algorithm?

- When the cycle is short, the fast finger can traverse it many times without noticing

Page 49: 1 RANDOM GRAPHS IN CRYPTOGRAPHY Adi Shamir The Weizmann Institute Israel May 15, 2007 7th Haifa Workshop on Interdisciplinary Applications of Graph Theory,

49

A better idea:

- Place checkpoints at fixed intervals- Update the checkpoints periodically

Page 50: 1 RANDOM GRAPHS IN CRYPTOGRAPHY Adi Shamir The Weizmann Institute Israel May 15, 2007 7th Haifa Workshop on Interdisciplinary Applications of Graph Theory,

50

Problem:

- Too few checkpoints can miss small cycles

Page 51: 1 RANDOM GRAPHS IN CRYPTOGRAPHY Adi Shamir The Weizmann Institute Israel May 15, 2007 7th Haifa Workshop on Interdisciplinary Applications of Graph Theory,

51

Problem:

- Too many checkpoints are wasteful

Page 52: 1 RANDOM GRAPHS IN CRYPTOGRAPHY Adi Shamir The Weizmann Institute Israel May 15, 2007 7th Haifa Workshop on Interdisciplinary Applications of Graph Theory,

52

Problem:

- You do not usually know in which case you are!

Page 53: 1 RANDOM GRAPHS IN CRYPTOGRAPHY Adi Shamir The Weizmann Institute Israel May 15, 2007 7th Haifa Workshop on Interdisciplinary Applications of Graph Theory,

53

Examples of unusually short cycles:

- cellular automata (e.g., when simulating the game of life)- stream ciphers (e.g., when one of the LFSR’s is stuck at 0)

Page 54: 1 RANDOM GRAPHS IN CRYPTOGRAPHY Adi Shamir The Weizmann Institute Israel May 15, 2007 7th Haifa Workshop on Interdisciplinary Applications of Graph Theory,

54

A very elegant solution:

Published by Nivasch in 2004

Page 55: 1 RANDOM GRAPHS IN CRYPTOGRAPHY Adi Shamir The Weizmann Institute Israel May 15, 2007 7th Haifa Workshop on Interdisciplinary Applications of Graph Theory,

55

Properties of the Nivasch algorithm:- Uses a single finger- Uses negligible amount of memory- Stops almost immediately after recycling - Efficient for all possible lengths of cycle and tail- Ideal for fast hardware implementations

Page 56: 1 RANDOM GRAPHS IN CRYPTOGRAPHY Adi Shamir The Weizmann Institute Israel May 15, 2007 7th Haifa Workshop on Interdisciplinary Applications of Graph Theory,

56

The basic idea of the algorithm:- Maintain a stack of values, which is initially empty - Insert each new value into the top of the stack- Force the values in the stack to be monotonically increasing

43 67 9 50 8 21

Page 57: 1 RANDOM GRAPHS IN CRYPTOGRAPHY Adi Shamir The Weizmann Institute Israel May 15, 2007 7th Haifa Workshop on Interdisciplinary Applications of Graph Theory,

57

The Stack Algorithm:

43 67 9 50 8 21

Page 58: 1 RANDOM GRAPHS IN CRYPTOGRAPHY Adi Shamir The Weizmann Institute Israel May 15, 2007 7th Haifa Workshop on Interdisciplinary Applications of Graph Theory,

58

The Stack Algorithm:

43 67 9 50 8 21

7

Page 59: 1 RANDOM GRAPHS IN CRYPTOGRAPHY Adi Shamir The Weizmann Institute Israel May 15, 2007 7th Haifa Workshop on Interdisciplinary Applications of Graph Theory,

59

The Stack Algorithm:

43 67 9 50 8 21

7 0

Page 60: 1 RANDOM GRAPHS IN CRYPTOGRAPHY Adi Shamir The Weizmann Institute Israel May 15, 2007 7th Haifa Workshop on Interdisciplinary Applications of Graph Theory,

60

The Stack Algorithm:

43 67 9 50 8 21

0

Page 61: 1 RANDOM GRAPHS IN CRYPTOGRAPHY Adi Shamir The Weizmann Institute Israel May 15, 2007 7th Haifa Workshop on Interdisciplinary Applications of Graph Theory,

61

The Stack Algorithm:

43 67 9 50 8 21

0 3

Page 62: 1 RANDOM GRAPHS IN CRYPTOGRAPHY Adi Shamir The Weizmann Institute Israel May 15, 2007 7th Haifa Workshop on Interdisciplinary Applications of Graph Theory,

62

The Stack Algorithm:

43 67 9 50 8 21

0 3 8

Page 63: 1 RANDOM GRAPHS IN CRYPTOGRAPHY Adi Shamir The Weizmann Institute Israel May 15, 2007 7th Haifa Workshop on Interdisciplinary Applications of Graph Theory,

63

The Stack Algorithm:

43 67 9 50 8 21

0 3 8 6

Page 64: 1 RANDOM GRAPHS IN CRYPTOGRAPHY Adi Shamir The Weizmann Institute Israel May 15, 2007 7th Haifa Workshop on Interdisciplinary Applications of Graph Theory,

64

The Stack Algorithm:

43 67 9 50 8 21

0 3 6

Page 65: 1 RANDOM GRAPHS IN CRYPTOGRAPHY Adi Shamir The Weizmann Institute Israel May 15, 2007 7th Haifa Workshop on Interdisciplinary Applications of Graph Theory,

65

The Stack Algorithm:

43 67 9 50 8 21

0 3 6 1

Page 66: 1 RANDOM GRAPHS IN CRYPTOGRAPHY Adi Shamir The Weizmann Institute Israel May 15, 2007 7th Haifa Workshop on Interdisciplinary Applications of Graph Theory,

66

The Stack Algorithm:

43 67 9 50 8 21

0 3 1

Page 67: 1 RANDOM GRAPHS IN CRYPTOGRAPHY Adi Shamir The Weizmann Institute Israel May 15, 2007 7th Haifa Workshop on Interdisciplinary Applications of Graph Theory,

67

The Stack Algorithm:

43 67 9 50 8 21

0 1

Page 68: 1 RANDOM GRAPHS IN CRYPTOGRAPHY Adi Shamir The Weizmann Institute Israel May 15, 2007 7th Haifa Workshop on Interdisciplinary Applications of Graph Theory,

68

The Stack Algorithm:

43 67 9 50 8 21

0 1 9

Page 69: 1 RANDOM GRAPHS IN CRYPTOGRAPHY Adi Shamir The Weizmann Institute Israel May 15, 2007 7th Haifa Workshop on Interdisciplinary Applications of Graph Theory,

69

The Stack Algorithm:

43 67 9 50 8 21

0 1 9 2

Page 70: 1 RANDOM GRAPHS IN CRYPTOGRAPHY Adi Shamir The Weizmann Institute Israel May 15, 2007 7th Haifa Workshop on Interdisciplinary Applications of Graph Theory,

70

The Stack Algorithm:

43 67 9 50 8 21

0 1 2

Page 71: 1 RANDOM GRAPHS IN CRYPTOGRAPHY Adi Shamir The Weizmann Institute Israel May 15, 2007 7th Haifa Workshop on Interdisciplinary Applications of Graph Theory,

71

The Stack Algorithm:

43 67 9 50 8 21

0 1 2 5

Page 72: 1 RANDOM GRAPHS IN CRYPTOGRAPHY Adi Shamir The Weizmann Institute Israel May 15, 2007 7th Haifa Workshop on Interdisciplinary Applications of Graph Theory,

72

The Stack Algorithm:

43 67 9 50 8 21

0 1 2 5 4

Page 73: 1 RANDOM GRAPHS IN CRYPTOGRAPHY Adi Shamir The Weizmann Institute Israel May 15, 2007 7th Haifa Workshop on Interdisciplinary Applications of Graph Theory,

73

The Stack Algorithm:

43 67 9 50 8 21

0 1 2 4

Page 74: 1 RANDOM GRAPHS IN CRYPTOGRAPHY Adi Shamir The Weizmann Institute Israel May 15, 2007 7th Haifa Workshop on Interdisciplinary Applications of Graph Theory,

74

The Stack Algorithm:

43 67 9 50 8 21

0 1 2 4 3

Page 75: 1 RANDOM GRAPHS IN CRYPTOGRAPHY Adi Shamir The Weizmann Institute Israel May 15, 2007 7th Haifa Workshop on Interdisciplinary Applications of Graph Theory,

75

The Stack Algorithm:

43 67 9 50 8 21

0 1 2 3

Page 76: 1 RANDOM GRAPHS IN CRYPTOGRAPHY Adi Shamir The Weizmann Institute Israel May 15, 2007 7th Haifa Workshop on Interdisciplinary Applications of Graph Theory,

76

The Stack Algorithm:

43 67 9 50 8 21

0 1 2 3 8

Page 77: 1 RANDOM GRAPHS IN CRYPTOGRAPHY Adi Shamir The Weizmann Institute Israel May 15, 2007 7th Haifa Workshop on Interdisciplinary Applications of Graph Theory,

77

The Stack Algorithm:

43 67 9 50 8 21

0 1 2 3 8 6

Page 78: 1 RANDOM GRAPHS IN CRYPTOGRAPHY Adi Shamir The Weizmann Institute Israel May 15, 2007 7th Haifa Workshop on Interdisciplinary Applications of Graph Theory,

78

The Stack Algorithm:

43 67 9 50 8 21

0 1 2 3 6

Page 79: 1 RANDOM GRAPHS IN CRYPTOGRAPHY Adi Shamir The Weizmann Institute Israel May 15, 2007 7th Haifa Workshop on Interdisciplinary Applications of Graph Theory,

79

The Stack Algorithm:

43 67 9 50 8 21

0 1 2 3 6 1

Page 80: 1 RANDOM GRAPHS IN CRYPTOGRAPHY Adi Shamir The Weizmann Institute Israel May 15, 2007 7th Haifa Workshop on Interdisciplinary Applications of Graph Theory,

80

The Stack Algorithm:

43 67 9 50 8 21

0 1 2 3 1

Page 81: 1 RANDOM GRAPHS IN CRYPTOGRAPHY Adi Shamir The Weizmann Institute Israel May 15, 2007 7th Haifa Workshop on Interdisciplinary Applications of Graph Theory,

81

The Stack Algorithm:

43 67 9 50 8 21

0 1 2 1

Page 82: 1 RANDOM GRAPHS IN CRYPTOGRAPHY Adi Shamir The Weizmann Institute Israel May 15, 2007 7th Haifa Workshop on Interdisciplinary Applications of Graph Theory,

82

The Stack Algorithm:

43 67 9 50 8 21

0 1 1

Page 83: 1 RANDOM GRAPHS IN CRYPTOGRAPHY Adi Shamir The Weizmann Institute Israel May 15, 2007 7th Haifa Workshop on Interdisciplinary Applications of Graph Theory,

83

Stop when two identical values appear at the top of the stack

43 67 9 50 8 21

0 1 1

Page 84: 1 RANDOM GRAPHS IN CRYPTOGRAPHY Adi Shamir The Weizmann Institute Israel May 15, 2007 7th Haifa Workshop on Interdisciplinary Applications of Graph Theory,

84

Claim: The maximal size of the stack is expected to be only

logarithmic in the path length, requiring negligible memory

43 67 9 50 8 21

0 1 1

Page 85: 1 RANDOM GRAPHS IN CRYPTOGRAPHY Adi Shamir The Weizmann Institute Israel May 15, 2007 7th Haifa Workshop on Interdisciplinary Applications of Graph Theory,

85

Claim: The stack algorithm always stops during the second

cycle, regardless of the length of the cycle or its tail

43 67 9 50 8 21

0 1 1

Page 86: 1 RANDOM GRAPHS IN CRYPTOGRAPHY Adi Shamir The Weizmann Institute Israel May 15, 2007 7th Haifa Workshop on Interdisciplinary Applications of Graph Theory,

86

Proof: The smallest value on the cycle cannot be eliminated by any later value. Its second occurrence will eliminate all

the higher values separating them on the stack.

43 67 9 50 8 21

0 1 1

Page 87: 1 RANDOM GRAPHS IN CRYPTOGRAPHY Adi Shamir The Weizmann Institute Israel May 15, 2007 7th Haifa Workshop on Interdisciplinary Applications of Graph Theory,

87

The smallest value in the cycle is located at a random position, so we expect to go through the cycle at least once and at most twice (1.5 times on average)

43 67 9 50 8 21

0 1 1

Page 88: 1 RANDOM GRAPHS IN CRYPTOGRAPHY Adi Shamir The Weizmann Institute Israel May 15, 2007 7th Haifa Workshop on Interdisciplinary Applications of Graph Theory,

88

Improvement: Partition the values into k types, and use a different stack for each type. Stop the algorithm when repetition is found in some stack.

43 67 9 50 8 21

Page 89: 1 RANDOM GRAPHS IN CRYPTOGRAPHY Adi Shamir The Weizmann Institute Israel May 15, 2007 7th Haifa Workshop on Interdisciplinary Applications of Graph Theory,

89

The new expected running time: (1+1/k)*n. Note that n is the minimum possible running time of any cycle detecting algorithm, and for k=100 we exceed it by only 1%

43 67 9 50 8 21

0 3 3

Page 90: 1 RANDOM GRAPHS IN CRYPTOGRAPHY Adi Shamir The Weizmann Institute Israel May 15, 2007 7th Haifa Workshop on Interdisciplinary Applications of Graph Theory,

90

Unlike Floyd’s algorithm, the Nivasch algorithm provides excellent approximations for the length of the tail and cycle as soon as we find a repeated value, with no extra work

43 67 9 50 8 21

0 3 3

Page 91: 1 RANDOM GRAPHS IN CRYPTOGRAPHY Adi Shamir The Weizmann Institute Israel May 15, 2007 7th Haifa Workshop on Interdisciplinary Applications of Graph Theory,

91

Note that when we stop, the bottom value in each stack contains the smallest value of that type, and that these k values are uniformly distributed along the tail and cycle

43 67 9 50 8 21

0 3 3

Page 92: 1 RANDOM GRAPHS IN CRYPTOGRAPHY Adi Shamir The Weizmann Institute Israel May 15, 2007 7th Haifa Workshop on Interdisciplinary Applications of Graph Theory,

92

Adding two special points to the k stack bottoms, at least one must be in the tail and at least one must be in the cycle, regardless of their sizes

43 67 9 50 8 21

0 3 3

Page 93: 1 RANDOM GRAPHS IN CRYPTOGRAPHY Adi Shamir The Weizmann Institute Israel May 15, 2007 7th Haifa Workshop on Interdisciplinary Applications of Graph Theory,

93

We can now find the two closest points (e.g., 0 and 2) which are just behind the collision point. We can thus find the collision after a short synchronized walk

43 67 9 50 8 21

0 3 3

Page 94: 1 RANDOM GRAPHS IN CRYPTOGRAPHY Adi Shamir The Weizmann Institute Israel May 15, 2007 7th Haifa Workshop on Interdisciplinary Applications of Graph Theory,

94

The Fundamental Problem of Cryptanalysis:

Given a ciphertext, find the corresponding keyGiven a hash value, find a first or second preimage

Invert the easily computed random function f where f(x)=Ex(0) or f(x)=H(x)

Page 95: 1 RANDOM GRAPHS IN CRYPTOGRAPHY Adi Shamir The Weizmann Institute Israel May 15, 2007 7th Haifa Workshop on Interdisciplinary Applications of Graph Theory,

95

The Random Graph Defined by f:Goal: Go backwards Means: Going forwards

Page 96: 1 RANDOM GRAPHS IN CRYPTOGRAPHY Adi Shamir The Weizmann Institute Israel May 15, 2007 7th Haifa Workshop on Interdisciplinary Applications of Graph Theory,

96

Possible solutions:

Method #1: Exhaustive search Time complexity T ≈ N. Memory complexity M ≈1.

Method #2: Exhaustive tableTime complexity T ≈ 1. Memory complexity M ≈N.

Time/Memory tradeoffs: find a compromise betweenthe two extremes, i.e., M << N and T << N, by using a free preprocessing stage.

Page 97: 1 RANDOM GRAPHS IN CRYPTOGRAPHY Adi Shamir The Weizmann Institute Israel May 15, 2007 7th Haifa Workshop on Interdisciplinary Applications of Graph Theory,

97

Hellman’s T/M Tradeoff (1979)Preprocessing phase:Choose m random starting points, evaluate chains of length t.Store only pairs of (startpoint,endpoint) sorted by endpoints.

Online phase: from the given y=f(x) complete the chain.Find x by re-calculating the chain from its startpoint.

Page 98: 1 RANDOM GRAPHS IN CRYPTOGRAPHY Adi Shamir The Weizmann Institute Israel May 15, 2007 7th Haifa Workshop on Interdisciplinary Applications of Graph Theory,

98

How can we cover this graph by chains?The main problem: Long chains converge

Page 99: 1 RANDOM GRAPHS IN CRYPTOGRAPHY Adi Shamir The Weizmann Institute Israel May 15, 2007 7th Haifa Workshop on Interdisciplinary Applications of Graph Theory,

99

Problem: Hard to cover more than N/t images

Why? A new path of length t is likely to collide with the N/t images already covered by the table, due to the birthday paradox

Hellman’s solution:

Use t “independent” tables from t “related” functions fi(x)=f(x+ i mod N) – note that inversion of fi inversion of f.

How can we cover this graph by chains?

Page 100: 1 RANDOM GRAPHS IN CRYPTOGRAPHY Adi Shamir The Weizmann Institute Israel May 15, 2007 7th Haifa Workshop on Interdisciplinary Applications of Graph Theory,

100

Local properties are preserved, while global properties are modified

- A point which had k predecessors in f will also have k predecessors in fi, but their identities will change.

- In particular, all the graphs will have exactly the same set of leaves, and values which are not in the range of f will not be covered by any path in any table

- On the other hand, the number of components, the size of the cycles, and the structure of the trees hanging around the cycle can be very different

Are these graphs really independent?

Page 101: 1 RANDOM GRAPHS IN CRYPTOGRAPHY Adi Shamir The Weizmann Institute Israel May 15, 2007 7th Haifa Workshop on Interdisciplinary Applications of Graph Theory,

101

Hellman’s trick is theoretically unfounded, but works very well in practice.

To invert a given image, try separately each one of the t functions, so both time and space increase by t:

T=t2, M=mt

By the birthday paradox, the maximum possible values of t and m in a single table satisfy t*tm=N

T/M tradeoff: TM2=N2.

Are these graphs really independent?

Page 102: 1 RANDOM GRAPHS IN CRYPTOGRAPHY Adi Shamir The Weizmann Institute Israel May 15, 2007 7th Haifa Workshop on Interdisciplinary Applications of Graph Theory,

102

Let c=N1/3

Use c tables, each table with m=c paths, each path of length about t=c (stopping each path at the first distinguished point rather than at a fixed length)

Together they cover most of the c3=N vertices.

Total time T=c2=N2/3 , total space M=c2=N2/3

A typical choice of parameters:

Page 103: 1 RANDOM GRAPHS IN CRYPTOGRAPHY Adi Shamir The Weizmann Institute Israel May 15, 2007 7th Haifa Workshop on Interdisciplinary Applications of Graph Theory,

103

Can be the best approach for cryptosystems with about 80 bit keys

Can be the best approach for cryptosystems whose keys are derived from passwords with up to 16 characters

Are such tradeoffs practically interesting?

Page 104: 1 RANDOM GRAPHS IN CRYPTOGRAPHY Adi Shamir The Weizmann Institute Israel May 15, 2007 7th Haifa Workshop on Interdisciplinary Applications of Graph Theory,

104

If each value has b bits, straightforward implementations require 2b bits per path

I will show now that only b/3 bits are needed.

This is a 6 fold saving in memory, which is equivalent to 36 fold saving in time due to the T/M tradeoff curve: TM2=N2

A new optimization of Hellman’s scheme:

Page 105: 1 RANDOM GRAPHS IN CRYPTOGRAPHY Adi Shamir The Weizmann Institute Israel May 15, 2007 7th Haifa Workshop on Interdisciplinary Applications of Graph Theory,

105

According to an old Chinese philosopher,

Paths in random graphs are like people:

They are born at uniformly distributed startpoints, but die at very unequally distributed endpoints!

The new optimization:

Page 106: 1 RANDOM GRAPHS IN CRYPTOGRAPHY Adi Shamir The Weizmann Institute Israel May 15, 2007 7th Haifa Workshop on Interdisciplinary Applications of Graph Theory,

106

The unequal distribution of endpoints:

distinguished points are much more likely to be near the leaves than deep in this graph, so very few of them will be chosen as endpoints

Page 107: 1 RANDOM GRAPHS IN CRYPTOGRAPHY Adi Shamir The Weizmann Institute Israel May 15, 2007 7th Haifa Workshop on Interdisciplinary Applications of Graph Theory,

107

Note that the startpoints are arbitrary, so for each one of the c tables we can choose a different interval of c consecutive values as start points

Since c=N1/3 , only b/3 bits are needed per startpoint.

Since we do not store endpoints, this is all we need!

The new optimization: Forget the endpoints!

Page 108: 1 RANDOM GRAPHS IN CRYPTOGRAPHY Adi Shamir The Weizmann Institute Israel May 15, 2007 7th Haifa Workshop on Interdisciplinary Applications of Graph Theory,

108

Divide all the c2 possible distinguished points into about c large regions:

0

2

9

5

6

1

3

8

4

7

During preprocessing, make sure that each region has at most one path ending at one of its distinguished points

For each region, memorize the startpoint of this path (if it exists), but not the value of the corresponding endpoint

c

c

Page 109: 1 RANDOM GRAPHS IN CRYPTOGRAPHY Adi Shamir The Weizmann Institute Israel May 15, 2007 7th Haifa Workshop on Interdisciplinary Applications of Graph Theory,

109

Problem: This can lead to too many false alarms

0

2

9

5

6

1

3

8

4

7

A false alarm happens when a stored endpoint is found, but its corresponding startpoint does not lead back to the initial value. In Hellman’s scheme, false alarms happen in about half the tables we try. This wastes time, but is hard to avoid.

Page 110: 1 RANDOM GRAPHS IN CRYPTOGRAPHY Adi Shamir The Weizmann Institute Israel May 15, 2007 7th Haifa Workshop on Interdisciplinary Applications of Graph Theory,

110

There are two types of false alarms here:

0

2

9

5

6

1

3

8

4

7

An old false alarm happens when the path from the initial value joins one of the precomputed paths:

Page 111: 1 RANDOM GRAPHS IN CRYPTOGRAPHY Adi Shamir The Weizmann Institute Israel May 15, 2007 7th Haifa Workshop on Interdisciplinary Applications of Graph Theory,

111

There are two types of false alarms here:

0

2

9

5

6

1

3

8

4

7

An old false alarm happens when the path from the initial value joins one of the precomputed paths:

A new false alarm happens when the path from the initial value enters a new endpoint:

Page 112: 1 RANDOM GRAPHS IN CRYPTOGRAPHY Adi Shamir The Weizmann Institute Israel May 15, 2007 7th Haifa Workshop on Interdisciplinary Applications of Graph Theory,

112

A surprisingly small number of new false alarms are created by forgetting the endpoints:

0

2

9

5

6

1

3

8

4

7

Endpoints which are likely to be chosen by the online phase were also likely to be chosen by the preprocessing phase

Since the Hellman parameters were chosen maximally, with high probability each new path is likely to end in one of the marked endpoints (otherwise we could add more paths to increase our cover!)

Page 113: 1 RANDOM GRAPHS IN CRYPTOGRAPHY Adi Shamir The Weizmann Institute Israel May 15, 2007 7th Haifa Workshop on Interdisciplinary Applications of Graph Theory,

113

The bottom line:

0

2

9

5

6

1

3

8

4

7

Simulations show that the total running time is increased only by a few percent due to new false alarms, and thus it is a complete waste to memorize the endpoints!

Page 114: 1 RANDOM GRAPHS IN CRYPTOGRAPHY Adi Shamir The Weizmann Institute Israel May 15, 2007 7th Haifa Workshop on Interdisciplinary Applications of Graph Theory,

114

Oechslin’s Rainbow Tables (2003)

Page 115: 1 RANDOM GRAPHS IN CRYPTOGRAPHY Adi Shamir The Weizmann Institute Israel May 15, 2007 7th Haifa Workshop on Interdisciplinary Applications of Graph Theory,

115

Use a different sequence of functions along each path, such as:

111222333 or 123123123 or pseudorandom e.g. 1221211

There are many other possible tradeoff schemes:

Make the choice of the next function dependent on previous values

Page 116: 1 RANDOM GRAPHS IN CRYPTOGRAPHY Adi Shamir The Weizmann Institute Israel May 15, 2007 7th Haifa Workshop on Interdisciplinary Applications of Graph Theory,

116

There was already a slight problem with the multiple graphs of Hellman’s scheme

What kind of random graph are we working with in such schemes?

Oechslin’s scheme is even wierder

Its time to define a new notion of a random graph!

Page 117: 1 RANDOM GRAPHS IN CRYPTOGRAPHY Adi Shamir The Weizmann Institute Israel May 15, 2007 7th Haifa Workshop on Interdisciplinary Applications of Graph Theory,

117

We introduced a new type of graph called Stateful Random Graph

Barkan, Biham, and Shamir (Crypto 2006):

We proved rigorous bounds on the achievable time/memory tradeoffs of any scheme which is based on such graphs, including Hellman, Oechslin, and all their many variants and possible extensions

Page 118: 1 RANDOM GRAPHS IN CRYPTOGRAPHY Adi Shamir The Weizmann Institute Israel May 15, 2007 7th Haifa Workshop on Interdisciplinary Applications of Graph Theory,

118

The Random Stateful Graph Model

• The nodes in the graph are pairs (yi , si), with N possible images yi and S possible states si.

• The scheme designer can choose any U, then random f is given.

• The increased number of nodes (NS) can reduce the probability of collisions and a good U can create more structured graphs.

• Examples of states: Table# in Hellman, column# in Oechslin. We call it a hidden state, since its value is unknown to the attacker when he tries to invert an image y .

y1y0

s0 Ux1

s1f

y2

Ux2

s2f

y2

Ux2

s2f

y2

Ux2

s2f

Page 119: 1 RANDOM GRAPHS IN CRYPTOGRAPHY Adi Shamir The Weizmann Institute Israel May 15, 2007 7th Haifa Workshop on Interdisciplinary Applications of Graph Theory,

119

The Stateful-Random-Graph Model – cont

U in Hellman:

xi=yi-1 + si-1 mod Nsi=si-1

y1y0

s0 Ux1

s1f

y2

Ux2

s2f

y2

Ux2

s2f

y2

Ux2

s2f

Page 120: 1 RANDOM GRAPHS IN CRYPTOGRAPHY Adi Shamir The Weizmann Institute Israel May 15, 2007 7th Haifa Workshop on Interdisciplinary Applications of Graph Theory,

120

The Stateful-Random-Graph Model – cont

U in Rainbow:

xi=yi-1 + si-1 mod Nsi=si-1 + 1 mod S.

y1y0

s0 Ux1

s1f

y2

Ux2

s2f

y2

Ux2

s2f

y2

Ux2

s2f

Page 121: 1 RANDOM GRAPHS IN CRYPTOGRAPHY Adi Shamir The Weizmann Institute Israel May 15, 2007 7th Haifa Workshop on Interdisciplinary Applications of Graph Theory,

121

The Stateful-Random-Graph Model – cont

U in exhaustive search:

xi=si-1

si=si-1 + 1 mod N, which goes over all the preimagesof f in a single cycle

y1y0

s0 Ux1

s1f

y2

Ux2

s2f

y2

Ux2

s2f

y2

Ux2

s2f

Page 122: 1 RANDOM GRAPHS IN CRYPTOGRAPHY Adi Shamir The Weizmann Institute Israel May 15, 2007 7th Haifa Workshop on Interdisciplinary Applications of Graph Theory,

122

Coverage and Collision of Paths

Definition: Two paths collide

if both yi= yj and si=sj

net coverage – the set of images yi covered by the M paths.gross coverage – set of nodes (yi , si ) covered by the M paths.

(yj-1 , sj-1 )

(yi-1 , si-1 )

y1y0

s0 Ux1

s1f

y2

Ux2

s2f

y2

Ux2

s2f

y2

Ux2

s2f

Page 123: 1 RANDOM GRAPHS IN CRYPTOGRAPHY Adi Shamir The Weizmann Institute Israel May 15, 2007 7th Haifa Workshop on Interdisciplinary Applications of Graph Theory,

123

The rigorously proven Coverage Theorem:

Let where M=N α, for any 0<α<1.

For any U with S hidden states,

with overwhelming probability over random f’s,

the net coverage of any collection of M paths of any length in the stateful random graph

is bounded from above by 2A.

,)ln(SNSNMA

Page 124: 1 RANDOM GRAPHS IN CRYPTOGRAPHY Adi Shamir The Weizmann Institute Israel May 15, 2007 7th Haifa Workshop on Interdisciplinary Applications of Graph Theory,

124

Reduction of Best Case to Average Case

Wi,j=1 if the net coverage of fi and Mj is larger than 2A (0 otherwise).

We want to prove that almost all the rows contain only zeroes by proving that there are fewer 1’s than rows in W.

For a given U, consider a huge table W of all the possible functions and all the subsets of M startpoints:

Page 125: 1 RANDOM GRAPHS IN CRYPTOGRAPHY Adi Shamir The Weizmann Institute Israel May 15, 2007 7th Haifa Workshop on Interdisciplinary Applications of Graph Theory,

125

Upper Bounding Prob(Wi,j=1)

Method:

• Construct an algorithm that counts the net coverage for fi and Mj.

• Analyze prob. that the counted coverage > 2A, i.e., Prob(Wi,j=1), over a random and uniform choice of start points Mj and function fi

The Combinatorial heart of the proof :

Define the notion of a coin toss with fixed success prob. q.Define the notion of miracle: many coin tosses with few successes.Prove that the probability of a miracle is negligible.

Page 126: 1 RANDOM GRAPHS IN CRYPTOGRAPHY Adi Shamir The Weizmann Institute Israel May 15, 2007 7th Haifa Workshop on Interdisciplinary Applications of Graph Theory,

126

Bounding Prob(Wi,j=1) – Basic Idea

Algorithm: traverses chains, stop chain on collision, counts net coverage.

…{M paths

We want to consider each output of f as a truly random number. However, this view is justified only the first time f is applied to an input (fresh value). Otherwise, the output of f is already known.

Recall: Collision only if (yi , si ) = (yj , sj ).

Page 127: 1 RANDOM GRAPHS IN CRYPTOGRAPHY Adi Shamir The Weizmann Institute Israel May 15, 2007 7th Haifa Workshop on Interdisciplinary Applications of Graph Theory,

127

Bounding Prob(Wi,j=1) – Basic Idea

FreshBucket1

FreshBucket2

FreshBucketS

···

Real execution of chain creation

43 U

FreshBucket3

FreshBucket4

Page 128: 1 RANDOM GRAPHS IN CRYPTOGRAPHY Adi Shamir The Weizmann Institute Israel May 15, 2007 7th Haifa Workshop on Interdisciplinary Applications of Graph Theory,

128

Bounding Prob(Wi,j=1) – Basic Idea

FreshBucket1

FreshBucket2

FreshBucketS

···

43 U

2

1

FreshBucket3

FreshBucket4

Page 129: 1 RANDOM GRAPHS IN CRYPTOGRAPHY Adi Shamir The Weizmann Institute Israel May 15, 2007 7th Haifa Workshop on Interdisciplinary Applications of Graph Theory,

129

Bounding Prob(Wi,j=1) – Basic Idea

FreshBucket1

FreshBucket2

FreshBucketS

···

43 U

2

1

7f

7

FreshBucket3

FreshBucket4

Page 130: 1 RANDOM GRAPHS IN CRYPTOGRAPHY Adi Shamir The Weizmann Institute Israel May 15, 2007 7th Haifa Workshop on Interdisciplinary Applications of Graph Theory,

130

Bounding Prob(Wi,j=1) – Basic Idea

FreshBucket1

FreshBucket2

FreshBucketS

···

43 U

2

1

7f U

6

2

7

FreshBucket3

FreshBucket4

Page 131: 1 RANDOM GRAPHS IN CRYPTOGRAPHY Adi Shamir The Weizmann Institute Israel May 15, 2007 7th Haifa Workshop on Interdisciplinary Applications of Graph Theory,

131

Bounding Prob(Wi,j=1) – Basic Idea

FreshBucket1

FreshBucket2

FreshBucketS

···

43 U

2

1

7f U

6

2

7

9f

9

FreshBucket3

FreshBucket4

Page 132: 1 RANDOM GRAPHS IN CRYPTOGRAPHY Adi Shamir The Weizmann Institute Israel May 15, 2007 7th Haifa Workshop on Interdisciplinary Applications of Graph Theory,

132

Bounding Prob(Wi,j=1) – Basic Idea

FreshBucket1

FreshBucket2

FreshBucketS

···

43 U

2

1

7f U

6

2

7

9f

9

U2

4

Not fresh! (although in another bucket)We already know f(2)=7.7 already covered by bucket1 –no need to add to fresh bucket4.

FreshBucket3

FreshBucket4

Page 133: 1 RANDOM GRAPHS IN CRYPTOGRAPHY Adi Shamir The Weizmann Institute Israel May 15, 2007 7th Haifa Workshop on Interdisciplinary Applications of Graph Theory,

133

Bounding Prob(Wi,j=1) – Basic Idea

FreshBucket1

FreshBucket2

FreshBucketS

···

43 U

2

1

7f U

6

2

7

9f

9

U2

4

7f

3U 2

FreshBucket3

FreshBucket4

Page 134: 1 RANDOM GRAPHS IN CRYPTOGRAPHY Adi Shamir The Weizmann Institute Israel May 15, 2007 7th Haifa Workshop on Interdisciplinary Applications of Graph Theory,

134

Bounding Prob(Wi,j=1) – Basic Idea

FreshBucket1

FreshBucket2

FreshBucketS

···

43 U

2

1

7f U

6

2

7

9f

9

U2

4

7f

3U 2

9f

Collision of a freshly created value – f(3) with a value already in the fresh bucket2. Chain must end.

FreshBucket3

FreshBucket4

Clearly: NetCoverage Σ |FreshBucket|

Page 135: 1 RANDOM GRAPHS IN CRYPTOGRAPHY Adi Shamir The Weizmann Institute Israel May 15, 2007 7th Haifa Workshop on Interdisciplinary Applications of Graph Theory,

135

FreshBucket1

FreshBucket2

FreshBucketS

···

43 U

2

1

7f U

6

2

7

9f

9

U2

4

7f

3U 2

9f

FreshBucket3

FreshBucket4

Analysis: what is the probability of a collision between a fresh image yi=f(xi) and the values in the fresh bucket?

Exactly |FreshBucket|/N – as yi= f(xi) is truly random and independent of previous events.

Problem: |FreshBucket| depends on previous probabilistic events – difficult to analyze.

Bounding Prob(Wi,j=1) – Analysis

Page 136: 1 RANDOM GRAPHS IN CRYPTOGRAPHY Adi Shamir The Weizmann Institute Israel May 15, 2007 7th Haifa Workshop on Interdisciplinary Applications of Graph Theory,

136

y1

FreshBucket1

FreshBucket2

FreshBucketS

···A/S

Coin Toss: is when xi is fresh and lower bucket is full. |UpperBuckets| #coin tossNetCoverage Σ|FreshBuckets| A+|UpperBuckets| A+#Coin TossesSuccessful Coin Toss: Coin toss and yi collides with lower bucket.

Prob. that a coin toss is successful: exactly q=A/(SN) (independent of previous events!)A successful coin toss Collision at most M successful coin tosses

y0

s0 Ux1

s1f

y2

Ux2

s2f

y2

Ux2

s2f

y2

Ux2

s2f

Set a threshold A/S in each bucketdivides bucket to lower and upper buckets.

Bounding Prob(Wi,j=1) – Coin Toss

Page 137: 1 RANDOM GRAPHS IN CRYPTOGRAPHY Adi Shamir The Weizmann Institute Israel May 15, 2007 7th Haifa Workshop on Interdisciplinary Applications of Graph Theory,

137

Miracles happen with very low probability:

Miracle: NetCoverage > 2A

Miracle After A coin tosses there are fewer than M successes

i.e., Prob(Miracle) Prob(B(A,q)<M),

where B(A,q) is a binomial random variable, with q=A/(SN).

Concluding the proof:Prob(Wi,j=1) is so small that #1 in table << #rows

so for any tradeoff scheme U with S hidden states,

almost all functions f cannot be covered well

even by the best subset of M startpoints. QED.

Page 138: 1 RANDOM GRAPHS IN CRYPTOGRAPHY Adi Shamir The Weizmann Institute Israel May 15, 2007 7th Haifa Workshop on Interdisciplinary Applications of Graph Theory,

138

Rigorous Lower Bound on the Number of Hidden States S

Net coverage of at least N/2

and therefore, the number of hidden states must satisfy:

,2

2 2 ln( ) NA SNM SN

.16 ln( ) 32 ln( )

N NSM SN M N

Page 139: 1 RANDOM GRAPHS IN CRYPTOGRAPHY Adi Shamir The Weizmann Institute Israel May 15, 2007 7th Haifa Workshop on Interdisciplinary Applications of Graph Theory,

139

Corollaries:

To cover most of the vertices of any stateful random graph, you have to use a sufficiently large number of hidden states, which determines the minimal possible running time of the online phase of the attack.

This rigorously proven lower bound is applicable to Hellman’s scheme, the Rainbow scheme, and to any other scheme which can be described by stateful random graphs.

Page 140: 1 RANDOM GRAPHS IN CRYPTOGRAPHY Adi Shamir The Weizmann Institute Israel May 15, 2007 7th Haifa Workshop on Interdisciplinary Applications of Graph Theory,

140

Conclusion:

Random graphs are wonderful objects to study

Understanding their structure can lead to many cryptographic and cryptanalytic optimizations

In this talk I gave only a small sample of the published and folklore results at the interface between cryptography and random graph theory

Page 141: 1 RANDOM GRAPHS IN CRYPTOGRAPHY Adi Shamir The Weizmann Institute Israel May 15, 2007 7th Haifa Workshop on Interdisciplinary Applications of Graph Theory,

141