https://github.com/amirgamil/zk-crush/blob/main/pages/crush.... const isMatch = React.useMemo(() => hash === crushHash, [crushHash]); Sure is a lot of work to do a string comparison 'efficiently'.
Confess your love with zero-knowledge
91–100 of 205 posts
Re: Confess your love with zero-knowledge
#92I hardly see how this is related to zero-knowledge
Re: Confess your love with zero-knowledge
#93Avoiding hash collisions has never been so important…
Re: Confess your love with zero-knowledge
#94Re: Confess your love with zero-knowledge
#95I sent it to my wife but she spelled her own name wrong and now she thinks I have a crush on someone else
OP should probably trim whitespace too. I sent it to my wife and it's not a match either, because there was a trailing space left by her keyboard.
Re: Confess your love with zero-knowledge
#96Last year my wife and I suspected we might have gotten each other the same Christmas gift, but didn’t want to spoil the surprise in case we didn’t. So we compared SHA256 hashes... and sure enough they both came out cb17007d (theragun)
This explained zero knowledge so much easier than that parable about the caves, thank you.
Mere hashing doesn't do that. For the crush example (This site), your crush could show everyone the link and their name. For that matter, someone could enter the names of everyone you knew in turn, until you were outed.
Re: Confess your love with zero-knowledge
#97Last year my wife and I suspected we might have gotten each other the same Christmas gift, but didn’t want to spoil the surprise in case we didn’t. So we compared SHA256 hashes... and sure enough they both came out cb17007d (theragun)
Doesn't work, because you can reasonably brute-force possible gifts.
Re: Confess your love with zero-knowledge
#98Re: Confess your love with zero-knowledge
#99Earlier quoted context omitted.
SHA256 doesn't work like that. Even single bit differences between inputs should result in very different outputs.
It doesn't. But there are so-called locality sensitive hashes. https://www.pinecone.io/learn/locality-sensitive-hashing/
Re: Confess your love with zero-knowledge
#100You give one black and one red to each person (Alice and Bob), and keep the last red.
The scheme is the following:
Alice will puts her two cards ON TOP of the remaining red card: to say yes, she puts her black card on top of her red card, to say no she does the opposite (red on top of black).
Bob will put his pair of cards BELOW the remaining red card, and to say yes he puts his black card at the bottom, with his red card in between, and to say no he does the opposite.
Then you cut the deck enough times to obfuscate who've done what, and you know that they've both day yes if you have the two blacks cards next to each other (or both at each ends of the deck). If anyone (or both of them) said no, you'd have black cards separated by one red card.