x and y such that x != y and H(x) = H(y).x and y is infinite, whereas H(x) and H(y) is limited to a a fixed set of bits.99.8% chance that two of them will collideH isH's, yesH has been proven to be collision-freeH(x) = H(y), it's safe to assume that x = y.H(x), it is infeasible to find x.H('heads') or H('tails') depending upon the outcome of the flip.x in this scenario!x is that there are only a couple of possible values for x.r is chosen from a probability distribution that has high min-entropy, then given H(r | x), it is infeasible to find x.(com, key) := commit(msg)
match := verify(com, key, msg)
To seal msg in envelope,
(com, key) := commit(msg) => then publish comTo open envelope,
key, msgverify() to check validitySecurity properties:
com, infeasible to find msg.msg != msg' such that
verify(commit(msg), msg') == true
commit(msg) := H(key | msg), H(key)
verify(com, key, msg) := H(key | msg) == com
where key is a random 256-bit value (say)
Security properties:
H(key | msg), infeasible to find msg.msg != msg' such that
H(key | msg) == H(key | msg')
For every possible output value y, if k is chosen from a distribution with high min-entropy, then it is infeasible to find x such that H(k | x) = y.
Given a "puzzle ID" id (from a high min-entropy distribution), and a target set Y, try to find a "solution" x such that
H(id | x) in Y
Puzzle-friendly property implies that no solving strategy is much better than trying random values of x. Useful property in Bitcoin mining.
A hash pointer is:
If we have a hash pointer, we can
The key idea here is to build data structures with hash pointers.
Merkle tree is a binary tree with hash pointers.
For proving membership in a Merkle tree, one needs to show only O(log n) items.
Advantages of Merkle trees
O(log n) time/space.Variant: sorted Merkle tree
O(log n), by just showing items before and after the missing data block.We can use hash pointers in any pointer-based data structure that has no cycles.
What we from signatures:
(sk, pk) := generateKeys(keysize)
sig := sign(sk, message)
isValid := verify(pk, message, sig)
Note:
sk = secret signing keypk = public verification keygenerateKeys must be a randomized algorithm verify(pk, message, sign(sk, message)) == true
Can't forge signatures
An adversary who knows the pk, and gets to see signatures on messages of his choice, can't produce a verificable signature on another message.
Algorithms are randomized
Limit on message size
Hash(message) rather than the message itselfFun trick: sign a hash pointer
Bitcoin uses ECDSA standard
generateKeys() or sign(), you've probably leaked your private key. GAME OVER.If you see sig such that verify(pk, msg, sig) == true, think of it as:
pk says, "[msg]".
To "speak for" pk, you must know matching secret key sk.
(sk, pk)pk is the public "name" you can use [usually better to use Hash(pk) because public keys are big]sk lets you "speak for" the identityskpk "looks random", nobody needs to know who you are
In [ ]: