Skip to content

Instantly share code, notes, and snippets.

@daveio
Created April 2, 2019 17:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save daveio/764a2fa0f022a9e01050eef5453b8c21 to your computer and use it in GitHub Desktop.
Save daveio/764a2fa0f022a9e01050eef5453b8c21 to your computer and use it in GitHub Desktop.

You have a shredder connected to an empty box, and various rubber balls. The balls are all the same colour, each ball of a certain type is identical, and each type is made of a different material from each other type. The shredder is special, in that if you put a ball in the shredder, the pattern of the shredded-up remains in the box will be the same every time, but distinct from any other type of ball.

You want to demonstrate to someone who does not know a secret that you and Bob both know that secret. The secret is a sequence of four balls of any type.

The secret value is a Type 1 ball, followed by a Type 2 ball, a Type 3 ball, and a Type 4 ball.

Bob puts his four balls in the machine, one after the other, and the resulting state of the box is a chaotic mess; each shredded bit has been buffeted around by all the other shredded bits. It looks nothing like any one ball’s pattern.

The state of the box is a hash of the secret information.

An observer looking at the hash (looking at the state of the box) would not easily be able to work backward and figure out which series of balls it corresponds to. The best they could practically do is to try all combinations of balls until they find a match.

Importantly, notice that an observer can verify that you and Bob both know the secret value, without the observer being privy to the secret value. All they have to do is see that the state of the box - the hash value - is the same in both cases.

@daveio
Copy link
Author

daveio commented Apr 2, 2019

Note that I'm aware that the authentication scheme in the last paragraph is deeply flawed. This isn't an implementation guide, it's an analogy for laypeople.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment