Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Confess your love with zero-knowledge (zkcrush.xyz)
327 points by amirGi on June 3, 2022 | hide | past | favorite | 189 comments


Last 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.


But it isn't zero-knowledge. If it was zero-knowledge, you would be able to know what you had the same gift/crush, but it would be impossible to prove to someone else.

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.


Non interactive zero knowledge allows one proof to be checked by many verifiers. I think folks would still consider that to be a zero knowledge proof no?

That said, yeah this hashing example is not zero knowledge because, among other things, the hash is not hiding.


It's been a while since I read about zero-knowledge proofs, so I wasn't aware of the non-interactive kind. But I read up on them, and as I understand, you have to pre-commit to a finite set of participants in the protocol who can verify that you have the proof.

Which makes sense: If the evidence (that you have a mathematical proof) could be convincingly shared with absolutely everyone, it wouldn't be zero-knowledge any longer. The whole point of zero-knowledge proof is that the evidence is only useful for the recipient(s).


An actual zero-knowledge way to do that would be the Socialist Millionaires' Protocol.


It is n-bit knowledge which is a more complete and valuable concept.


My favorite analogy is someone has a Wheres Waldo photo. They can prove to you they know where Waldo is by getting a piece of paper (the size of the photo) with a cut out around Waldo. When they hold it up and show you Waldo through the cutout you have zero knowledge about his location.


If the mask paper is the same size as the waldo photo, one can trivially tell where waldo is by just looking at the location of the cutout

I think for this to work, the piece of paper with the cutout must be much larger than the full waldo photo. The actual cutout would always be in the center of this mask paper. Then the waldo photo can be moved around behind this mask.


But then you cannot prove anymore that you know where Waldo is, no?

Previously, the proof relied on the alignment between the picture and mask being constant, but this is no longer the case. Now wherever Waldo actually is, every mask fits since you can just freely move around the picture.


To align the cutout with Waldo, you need to know where he is. Since the entire picture would be hidden behind the mask, the other person won't know where in the picture that location is, but by aligning the mask cutout you can prove _your_ knowledge about Waldo's location.


The point of the proof is to demonstrate that the prover knows where Waldo is, not to convey Waldo's location to proof recipient.


Good catch


As the sibling comment says, neither gp comment nor this post are zero-knowledge.

But in addition to the definition given in sibling comment, here's another necessary condition of a zero-knowledge proof: it must be possible to forge transcripts (i.e., one party writing both sides of the interaction) of a zk proof even without possessing the secret.


There are a couple of science and science fiction authors that started posting hashes or signatures for their predictions for the future, and then post it after events played out.

I think the idea is that unlike pundits predicting the future, you don't want your particularly clever friend speculating out loud ten minutes into the suspense movie what they think is going on because they either guess the ending, or their guess makes you figure out the ending, and then it's 70 minutes of sitting there reading all of the other foreshadowing and not getting to enjoy any of it.


>unlike pundits predicting the future

Isn't your example pundits predicting the future? So why are hashes useful to those pundits in your example?


Doesn't work, because you can reasonably brute-force possible gifts.


You could reveal the hash letter-by-letter and stop as soon as a letter differs so there's more possibilities.


> stop as soon as a letter differs

Oops - you just exposed a timing attack side channel


Yeah I'm not sure what's the best protocol that's actually zero-knowledge here, but since we both trusted each other to only want to find out whether or not our gifts were the same, and otherwise to not spoil the surprise, this did the job.


You could write a script that does the hash comparison for you and simply outputs “Yes” or “No” for whether the hashes are identical.


You could just write a script that lets you write an input and your spouse writes an input and then compares the two inputs without showing them - no need for hashing at all.


Sure, but the example is contrived, as it serves to illustrate the point in an easily digestible (heh) way. In real world applications, both the possible messages and the possible hashes would be way too large to brute force.


You can similarly brute force mutual acquaintances in TFA


But why would you do it?


I think the point is just that this is a misleading example of zero-knowledge proofs which are meaningful different cryptographically.


Not technically zero knowledge, since you could brute force search her non-matching hash later.

A true ZK comparison[1] would just return a true or false without exposing any other information such as the hash of the item.

I'm sure the hash was good enough for your purpose, however!

[1] https://en.wikipedia.org/wiki/Socialist_millionaire_problem


What did you hash? The name of the product? Or the UPC or something? I am curious.


We both hashed "theragun" in all lowercase. We actually bought each other two different models of Theragun but it was pretty natural to refer to them with that string.


Relationship goals


I 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.


Don't forget normalizing unicode. You don't want to see Jorgé fighting with Jorgé.


It does handle emojis though! In case... Uhhh... You have emojis in you name?


Don't give Musk any ideas!


Now you either gotta point out her mistake or you gotta admit you have crush on someone else. Good luck getting out of this :)


I told her I have zero knowledge of any of this


I did the same.

I never had a thing for good spellers.


This protocol has some downsides - if you share the link with large adversarial group (e.g. your school) they can brute force your crush name and it’s basically no different then embarrassingly shouting out your crush name in public and it has problems with canonical names.

Instead we can alter it and fix this problems: Bob will find out his crush’s public key, encrypt "you are my crush" message to it and post it with his own signature to public bulletin (blockchain can be good shelling point). When crush decrypts message they will see proper string, while everyone else will see gibberish.

- to solve problems with key distribution we can use "identity based encryption". it requires trusted third party (e.g. school administrators) but it solves problem for key generation of participants. With identity encryption bob can encrypt message to some canonical identity such as school email. Owner of that email can prove it’s identity to the third party and receive corresponding private key.


> blockchain can be good shelling point

I can absolutely guarantee that the school generation would not naturally gravitate to the blockchain as a source for social interaction, since it's not (yet) running social media. I'm assuming TikTok (if it's common to post your own videos and not just consume?) or Snapchat (or whatever came next, that's probably old enough to be uncool by now I guess?)

EDIT: I just saw the suggestion that school administrators be identity providers for a crush-admission website. OK, now I'm _sure_ this must be satire. Well played.


Thanks to other people pointing out, I now see that there is still a fundamental problem — crush can see that you appointed them to be your crush without liking you back, and the solution is that: 1) everobody precommits to your crush set in advance 2) users use mpc protocol that will ensure that your crush reveals if both of you precommitted to each other. (I guess it's similar to "Yao millionaire problem" where two parties calculate "x < y" without revealing x and y. but you calculate "x == y" where x and y is values that you committed to previously and you dont reveal x and y)

Previous variant does not need any blockchain because you can just embed encrypted message to the web page similarly to the original hash variant (really it's the same as sending private message to your crush) but MPC variant probably needs blockhain because that's a perfect way to publicly precommit to something.

Note: there is still the possibility that you can precommit to "x is my crush" without x being your real crash to lure out if you are crush of x.

P.S. I think that's a good illustration of a service that can't be done without crypto and have similar properties.


This guarantees the crush will never see their message.


And then someone will guess that the school administrators password is “StudentsSucks2022” and steal all the private keys they left in their documents folder.


You are correct, but I think "identity based encryption" protocols can run in MPC mode. Multiple parties will generate distributed secret that will be used to generate private keys. Anyone can easily generate public key for any identity (e.g. email) for the given "key generator" setup using public data of this setup. But for a user to get their private key, they need to assemble secrets by proving their identity to multiple independent parties - you have to hack every one of them to restore the private key of user.


I remember reading a joke research paper about something like this. It explored all currently known methods of confessing your love, their pros and cons, and had a funny acronym for each. It then proposed a newer, secure algorithm for confessing to your crush if the feeling was mutual, and without leaking information to 3rd parties. I'm trying to find it, but I don't have it saved and I haven't found it on Google yet.



I'm really impressed with how readable and how funny that is, but I'm sure I'm missing at least one of the jokes contained within. In particular, they suggest an extension to their protocol called "SENPAI-MTT (More Than Two)", which I'm sure must be a cleverly chosen backronym, but I can't work out why (or if) it is funny.

My initial thought was that it could be a reference to the Japanese verb meaning "to look"[0], such as mite ita ("was looking") but represented in vowelless chatspeak[1]. More logical, though, would be the verb meaning "to notice"[2], but the imperative would be kizuite kudasai ("please notice!")[2], and that doesn't match "MTT" at all.

[0] http://www.japaneseverbconjugator.com/VerbDetails.asp?txtVer...

[1] https://old.reddit.com/r/LearnJapanese/comments/bupbs9/about...

[2] http://www.japaneseverbconjugator.com/VerbDetails.asp?txtVer...


I know absolutely nothing about this but would it not be referring to polygamous relationships?


The paper does discuss such relationships, but "SENPAI-MTT (More Than Two)" is an extension to the protocol to allow a participant to choose from more than two (i.e. Crush / No Crush) possible opinions about someone.

It's in the section titled "Ternary Responses", and covers the use case of a participant wanting to express "Maybe" as an opinion.

Oh, actually, I might have worked it out. It could be that "More Than Two" is designed to be somehow the reverse of "Less Than Three", which represents a heart.


This is probably the geekiest CS paper I ever read!


Thank you! I had a feeling the name had something to do with anime, but I couldn't remember what.


This has nothing to do with zero-knowledge crypto. Here's some intuition about what zero-knowledge is actually about: https://minaprotocol.com/blog/kimchi-the-latest-update-to-mi...


It's my understanding that zero-knowledge concepts can be extended to databases, in a way where I can query a database and get a result without knowing the contents, perhaps to pass on to a trusted system to perform another action.

Depending how you slice it, I either do or don't get to know if the result set is empty. In the latter case, there's a variation of this crush registration system where I don't get to know if Sally has a crush on me, but I do find out if anyone has a crush on me. Of course if the answer is empty set, I don't know if I'm unloved or only loved by people that don't use the app. Which could be pretty heavy.


This system is not zero knowledge, because publishing the link actually leaks info to non-intended recipients.

Suppose I share a link, and you suspect I am trying to steal your partner. You could easily check whether my crush is your partner.


What you’re describing is more like MPC to me


Crypto like cryptography or crypto like cryptocurrency?


Aren't they the same? Cryptocurrency is called that because it uses cryptography.


As in cryptography, although the link I posted also explains how it can be applied to smart contracts


Love these kind of ideas. Reminded me of once I was trying to allow access to a file with a password. It wasn't any super-secret file or anything, just a CV of a friend hosted on a static file server and she wanted it to "protect" it with a simple password (just didn't want it to be directly available to anyone viewing the homepage. No mission-critical secret of any kind otherwise).

Having no real/strict security requirements and being lazy to go server-side scripting, I simply hashed the password. Noted the hash. Saved the file into a folder like "/${hash}/Proper Name.pdf". Hashed the hash again and embedded it into client-side JS. Wrote a JS function that took the input, hashed it twice, and if second hash of the entered password matches that, download the file "/${first hash}/Proper Name.pdf".

It worked like a charm, but please note that this is prone to attacks so if anyone reading this thinks it's a good idea to implement actual security, DO NOT. It is not. Fun to play with though.


What attacks?


Among other things, it’s almost certainly the case that the web server isn’t implementing a constant-time string comparison for the URL, which enables you to brute-force the value one character at a time.


Woah, that sounds interesting, do you have any links to share regarding that issue?


Maybe the browser or an extension leaking the URL of the file, which could ultimately get indexed in a search engine.


Fair point, though search engines are aware of special headers that tell them not to publicize the link to the content. Would it be any safer with the key in the GET parameter string? Search engines still usually treat this string as part of the address.


This is some strange notion of zero-knowledge.

If Bob publishes his link, and I want to know who his crush is, I can simply try all our classmates' names and quickly find out that it's Alice.

Those games only make at least a bit of sense when everybody enters their crush and only when matching both get notified.

Also brute-forceable, but at least it's quadratic (if you suspect nothing about crushes, which is unrealistic in itself).


If it tells you how many letters are right, and how many are in the right place, it could become Datle.


Challenge: build something worthy of being called 204Date (2048 clone).


Smashing together people to win at dating? Isn't that just Tinder?


Tinder goes in two directions. This would go in 4 directions. Swipe up to send them to your friends, down to your enemies, left to the void, right to you.


You start with 2048 single people, and have to act as matchmaker to pair them off into married couples who each produce at least one child. A generation later, you take the 1024 first-borns of each couple and have to pair them off too, into 512 new pairings.

Repeat that long process until there is just one couple left, whose first-born you then propose to. Having lived long and healthily enough to complete this game, you must have some very desirable genes and/or wealth, and you'll be good friends with basically all this person's ancestors, so there's a strong chance they'll say yes, despite the age difference.


Match fruits until you get a date?


Careful, FruitNinjaDating could get interesting if not messy


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/


Sure, such hashes exist. SHA256 is not one of them.


* Flirdle


> Those games only make at least a bit of sense when everybody enters their crush and only when matching both get notified.

Even then, among heterosexuals they will suffer from the same problem as basically every software platform for romance among straight people: the massive asymmetry in interest between men and women. Men would copy and paste virtually every woman they know into the system as a "crush," so they can find which if any of their female acquaintances might be interested, and then they would decide who to pursue.


> Men would copy and paste virtually every woman they know into the system as a "crush," so they can find which if any of their female acquaintances might be interested, and then they would decide who to pursue.

Smart men would, who know their place in the world. Any of them are good enough for you, really. Take the one that you like the most out of the ones who like you. Is this a problem? If it weren't asymmetric, it would be hopeless. Instead, most men get the choice between one or more interested women, and most women get a response from one or more of the men they were interested in.

It's better if one side isn't as picky as the other. The other options are that only a couple of people match up at all, or everyone getting a response from everyone i.e. no signal at all.

edit: I mean, isn't that Bumble?


I don't follow this, either logically or in practice.

Granted I've never dated as a gay man or as a lesbian, but from what I've observed it seems to me a much smoother and more mutual process than straight dating. I've even heard from bi men about how much easier and less stressful it is to date men than women. AFAICT when both parties are on a level playing field, and there's not a massive asymmetry in power, interest, and investment, there's a lot less grief overall.

> edit: I mean, isn't that Bumble?

Bumble is a valiant attempt to fix this issue but it seems to mostly be a failure. An average man may occasionally get a message (which will usually just say "hi"), but the asymmetry in interest is still there, and it's still mostly men's responsibility to do the real initiating.


Indeed, a similar "secure" crush confession on an MIT facebook group was exploited in this way, by brute forcing every name in the student directory.


You'd want to use asymmetric public key cryptography so that Bob could hash his message with Alice's public key, and it could only be decrypted with Alice's private key.


That still lets Alice find out.

I don't see a clear way of mapping the concept of a zero knowledge proof to the crush problem.

But the best I can come up with is:

1) No one learns that Alice (claims to) have a crush on Bob

2) Unless Bob also claims to have a crush on Alice, in which case.

3) Only Bob learns that Alice has a crush on him.

4) If Bob learns that Alice has a crush on him, Alice learns that Bob has a crush on her.

5) All the above guarantees are symmetric if you swap Bob and Alice.


Seems to me such a system must make it expensive to claim to have a crush on someone. Otherwise Bob can just claim to have a crush on everyone and will find out who crushes on him.


For heaven’s sake just call her!


That lets Bob confess semi-deniably to Alice (if Alice is willing to share her private key, she can still show Bob's confession to Carroll and prove that it's authentic). But it still doesn't do any matching; Alice will know about Bob's feelings whether she returns then or not.


Yup, everyone publishes their public keys. No one’s private keys gets published (fake crush created).

I’m not sure if zero-knowledge proofs exist for love outside of action - repeated acts of commitment over time (to reduces the confidence that someone doesn’t love you).


This could be a fun way to teach a class about the vulnerabilities around hashing. Strong hash != strong protection.

Maybe the second half of the class could be about designing a more secure system. Or use this dilemma to explain public-private key encryption.


Yeah, it is like hashing a phone number to protect its owner's identity. With a small domain known by the attacker hashing isn't really one-directional.


Or just tell your crush, without sharing URLs with everyone


Easy as an adult. But as a kid I feel like we jumped through soooo many hoops to de-risk telling someone we had a crush on them.

I remember those reallllly early games like MASH or even early "compatibility" apps. Very coy.


Yes, I can see how -- as a kid -- sharing an URL of your hashed crush with the world is not going to be awkward at all.


Putting links in your tiktok/whatever profile doesn't seem like very unusual nowadays...


Awkward is the name of the game.


There's nothing wrong with only wanting to reveal a crush if it's somewhat returned. If it isn't, you're just putting them in an uncomfortable position for no good reason.


And this hash url absolutely doesn't solve this problem


I feel like this could be a good implementation.

"Find out if your crush fancies you, just choose them from your contacts:"

...

"Message 'hey there, I like you' sent"


Or even easier, use a SHA-256 reversing service that has all names.


that's because it's not zero knowledge, it's password hashing.

a zero knowledge proof would do something like prove a valid attestation of love, but reveal nothing about who (other than maybe membership in some large enough set).


Bob's crush, though, works at the ice cream store on the corner.


And when everyone is an actual adult, not a manchild or other people without a fully formed prefrontal cortex and thus prone to making ugly, life-changing decisions - for themselves and others - on a dime.

That's most of the demographic for this product. The number of over-25 people, not in a committed relationship, who still haven't figured out how to ask people out, is pretty small.


I dunno. I'm reasonably well adjusted and apparently even decently attractive, and I still have a super hard time with the whole asking people out thing. I've been lucky enough to have people ask me out but otherwise I'm not sure I'd have had much luck dating at all.

This tool doesn't do what I'd want, but a tool that did would be kinda neat :)


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'.


Definitely a waste. `useMemo` has a bunch of performance issues related to it and should only be used when absolutely necessary.


That's mad because the useMemo clearly has to do an equality check to see if it changed anyway...


Humorous, but not zero-knowledge at all. They could be on to something here though. Maybe blockchain's "killer app" will be Verifiable Romance?


Instead of getting your SO's name tattooed on your body that you'll regret in a few years, you'll instead get your names added to the blockchain...that you'll regret in a few years.


Dont give them any ideas. The RomanceSmartChain is only a few months out at this rate.


$LOVE is MOONING!!

Blake2b + Hybrid PoW chain with LOW TRANSACTION FEES and 4 TX/S THROUGHPUT now CONFIRMING COMMITTED RELATIONSHIPS with blockchain technology! Your relationship isn't valid until there are AT LEAST 36 CONFIRMATIONS on $LOVE chain!!1

Also now supporting ON-CHAIN unique NFTs for couples for low fees!!


Link to white paper please


"Couple to Get Married on the Bitcoin Blockchain at Disney Bitcoin Conference"

Sep 23, 2014

https://bitcoinmagazine.com/press-releases/couple-get-marrie...


Zero-knowledge describes the OP w.r.t zero-knowledge-proofs.


Similar to how blockchains killer app is delivering pizza. You deliver the pizza as normal then do something something blockchain and now it is blockchain.


I hardly see how this is related to zero-knowledge


I believe "zero knowledge" refers to the third party here. That is, you give it A => B, and it tells you if B => A was given previously, without it knowing the actual values of A or B. While you might be able to brute force the system by trying every name you know, the third party can't unless you give the third party a registry of names to try.

Related is the humorous paper "Solving the Dating Problem with the SENPAI Protocol" [1], though the solution in that paper does not rely on a third party.

[1]: http://sigtbd.csail.mit.edu/pubs/2016/paper10.pdf


Yeah zero-knowledge is supposed to give you no usable information, but brute-forcing aside, the fact anyone can learn they are not the target is knowledge, right?


> the fact anyone can learn they are not the target is knowledge, right?

To a point, however, you've also described a Bloom filter reasonably well. That is it would show whether their hash is not in the set.


right.


Nice. Kinda along the lines of what made the current generation of dating apps (starting with Tinder) so popular. Take a large group of 1st and 2nd degree friends. People anonymously select who all they'd like to get with. If there's a match, both parties are notified. If not, no one gets to know. It's such a simple concept, and it's odd that someone like Facebook wasn't able to capitalize on it first despite providing all the infrastructure (the social graph) to make a service like this possible in the first place.


Facebook knows enough about you to skip that step and just match you.


> People can enter their names into this unique link to generate the hash of their name. If the generated hash matches, they'll be notified *you* are *their* crush

Don't mean to be pedantic, but shouldn't it be "they'll be notified *they* are *your* crush"?


It's missing quotes.

> they'll be notified "you are their crush"


“Works on contingency? No, money down!”


Yes it seems to be worded incorrectly.


Well... hactually... This is kind like the opposite of zero-knowledge, where everyone can know your crush just by entering all suspecting names in the link.


I own the domain ilikeyou.fyi and considered doing something very much like this. I rejected that plan for all the reasons above.

It could be done better with public/private key cryptography, but then your audience has to be able to deal with that.

Oh well, it's on my backlog down in the "I'll never actually get there" section.


Small idea, no idea how useful if at all but maybe it could be a simple page with a list of reasons why the sender likes the recipient, and/or a YouTube playlist of songs that remind them of the recipient etc


Maybe don't display the hash and self destruct after n bad guesses or something.


Jacques Patarin[1], my cryptography teacher at university introduced us with zero-knowledge proofs with a simple real-life zero knowledge scheme for this exact purpose. All you need is 5 cards, 3 identical red and 2 identical blacks.

You 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.

[1] https://fr.wikipedia.org/wiki/Jacques_Patarin


I might be an old timer but there used to be a site where you would put in your email and your crushes email and if they did the same you’d both be notified. I don’t remember the name of the site now though.



Wow that is evil genius.


allyourcreditarebelongtous.com?

i assume at this point in life that any site doing something as silly as this has ulterior motives for the site's existence.


"First and Last name capitalised"

Seems like someone hasn't read the famous "Falsehoods Programmers Believe about Names"[0]

[0] https://www.kalzumeus.com/2010/06/17/falsehoods-programmers-...


I mean, it’s basically a helpful hint there to maximize the chance that both parties include the same names with the same capitalizations


And it's a unhelpful suggestion to butcher names that aren't correctly formatted that way.


I mean, you would want to handle this correctly for a "real" thing, but this is just a cute demo and that's gonna be a close enough approximation to work for this I think.


Maybe they did, got confused and gave up. How would you deal with 4, 11, 12+13, 14 and 18 here?


Quite simple: you don't deal at all. That's zero assumptions about the name. Let them eat cake and enter whatever they want. The user should know their sweetie well enough to guess what they will enter as own name. This is an assumption about their level of mutual knowledge, true, but not one about the naming scheme.


On the contrary, there is a very strong and completely invalid assumption: that Alice will type her name in exactly the way Bob typed her name, and vice versa, that neither will misspell it, that either both will use the official name or both will use the same nickname.


This is a design decision that will very likely lead to missed matches, bold of you to assume it's desirable but even that doesn't answer the entire ordeal. How are they going to enter the name, have you read 11?


> 4. People have, at this point in time, one full name which they go by.

The relationship between person and name is one-to-many

> 11. People’s names are all mapped in Unicode code points.

You can implement custom characters, i.e. https://en.wikipedia.org/wiki/Private_Use_Areas or have a process for exceptions

> 12. People’s names are case sensitive. 13. People’s names are case insensitive.

You can store this as an attribute

> 14. People’s names sometimes have prefixes or suffixes, but you can safely ignore those.

This can be other fields if you're trying to structure the data, or you can simply store the entire name as a contiguous field.

> 18. People’s names have an order to them. Picking any ordering scheme will automatically result in consistent ordering among all systems, as long as both use the same ordering scheme for the same name.

Don't string compare names as a test for equality.

The obvious response to this is: that's too hard (/impossible to do). But that's just the reality of the situation. These issues are not necessarily possible to solve. #21 in particular makes this application very broken even with very plain vanilla western names.


To stop my friends from using this to guess who my crush is, a fun iteration could be instead of entering the person’s name, you enter the last text you sent, place you met, etc. Something only the two of you would know … and maybe even something romantic :)


Virtually guaranteeing you’d never match even if you match.


that's called salting.


It's fascinating to see how far people are willing to go to avoid the awkward feeling of potential rejection. I mean I have been there. But as I am older this just feels funny. If you like someone just tell them. Rejection is part of the fun.


Right? I embraced rejection therapy and the results were scary good. A whole new world opened up, not only in romance, but sales, financing, recruitment, etc.


Avoiding hash collisions has never been so important…


What if your girlfriend and wife have the same hash?



Nice, quick implementation. It's cool that it's all client side. People have pointed out the weaknesses as far as non-crushes brute forcing the answer but still this is interesting. I'll have to digest the implications more. I created https://aytwit.com/thoughter which takes the basic idea here to a much more involved extreme. It got some good traction on hackers news a few years ago and I've improved it a lot since then. I still want to make some improvements as far as moving more of the cryptography client-side so people don't have to trust my server as much, yet not ALL client side like this for more convenience and privacy.

Thanks for the submission!


I used a similar technique to obfuscate the answers in a silly TV quiz[0] I wrote a couple of years ago.

I have a terrible habit of looking at the source of web-based puzzles to discover the solutions and wanted to make something where that was impossible.

My solution was to use the given answers as the key to decode a small blob of data. Multiple correct answers (different spellings) were handled by simply encoding the blob multiple times and trying them all.

Everything happens client side but at no time does the client store any information about the answers unless the user proves they know them by typing them in.

[0] https://sheep.horse/2020/4/tv_opening_sequences_quiz.html


How is this zero knowledge? It could have been a simple string equality on the back end.


I found this blog post a great explanation: https://blog.cryptographyengineering.com/2014/11/27/zero-kno...

The cave parable always confused me. This blog-post made it click. I think the 'secret passage in the cave' is just a very bad stand-in for knowledge. Perhaps a maze would be better. But the parable also focuses to much on 'creating false transcripts' without explaining why being able to fake it makes it 'zero knowledge'.



Fun concept, but quite easy to use with a malicious intent. It would be better if only people who have a crush on you could use the link (meaning the confession would work both ways)


Reminds me a paper I co-authored all the way back in 2000! https://www.cl.cam.ac.uk/~fms27/papers/2000-StajanoHar-roman... wow that's a long time ago!


What does this achieve that posting "text me and I'll tell you if I have a crush on you" doesn't?

Or texting your crush directly?

I suppose it's a useful commitment mechanism for proving you aren't telling everyone they're your only crush, but that seems a bit of a niche use case.


1. Since it's an external web site with a little bit of tech behind it that presumably others are using, it might seem less desperate or strange than the post you suggest.

2. The potential crushee can do the check without notifying you they're doing so. They might be too embarrassed/intimidated to actually tell you they're interested in whether you have a crush.


Yeaaahh, but no. It doesn’t need to be mutual. Guess can be correct but the reveal will probably just out you and cause problems. For confessing your love do it openly, they are no short cuts.


*Hires team of synchronized skywriters to draw SHA-256 hash above crush's location*


you are the chosen one.


Wrapping this in a native app could be a nice little moneymaker. Lots of speed dating events could use this to help match attendees that were interested in each other.


Maybe this would be better using Twitter/Instagram/TikTok/Snapchat handles? (I don't use 75% of those, but presumably they all use handles.)


I can see this being somewhat popular on some campuses.


What if someone has a list of possible crushes you may have? Social circles aren’t incredibly large


I think this is the first time I've understood zero-knowledge communication.


This isn't zero knowledge, like, at all

"The essence of zero-knowledge proofs is that it is trivial to prove that one possesses knowledge of certain information by simply revealing it; the challenge is to prove such possession without revealing the information itself or any additional information."


"In cloud computing, the term zero-knowledge (or occasionally no-knowledge or zero access) refers to software services that store, transfer or manipulate data such that it is only accessible to its owner, not to the service provider."


> In cloud computing

Your quote heavily misspells "bullshit marketing" ;)

For marketing reasons, people try give things fancy names, even if those names are misused and are completely wrong. This is exactly what happened with all those "zero-knowledge encrypted cloud storages" and so on.


This seems to imply terms can only have and only one “right” definition, which is not how languages work, at all.

Clearly there are two big clusters of meaning for “zero-knowledge” and they seem distinct enough to not overlap. Seems fine to me.


Well, you're right.

My problem is that they started doing this my using "zero knowledge" as a term from cryptography. The trend had started in early 2010s or so, as cryptocurrencies and all things crypto became popular, people realized they could use that vibe for profit.

So cloud storage providers in particular had realized "zero knowledge" sounds cool and fancy and started using it in their marketing despite stealthily assigning it entirely different meaning from where they took it from (well, some had their cryptographic designs all backwards recognizably even to my uneducated brain - false promises when most customers don't have sufficient knowledge and awareness, business as usual). They were critiqued for it, and they just shrugged it off because who gives a fuck about some angry nerds insisting on some correct word usage. And so this shit caught on, and yes, now we have two meanings.

I suppose I got to let it go, but I feel upset about the outcome.


As far as I understand it (and I'm not a cryptographer!), it is not zero knowledge.

Zero knowledge means you can prove you know something without disclosing any additional information about it, at all - that's why it's called "zero". And here, a hash of crush name is exposed, so it's not.

Check this out for a much better explanation: https://crypto.stackexchange.com/questions/70877/is-a-hash-a...


>Zero knowledge means you can prove you know something without disclosing any additional information, at all

This is physically impossible and definitely not what ZK means.


I could be wrong, yes.

But why impossible? Take this example: https://en.wikipedia.org/wiki/Zero-knowledge_proof#Discrete_... - all parties exchange are essentially random numbers (which doesn't count as "additional information"), yet they establish the fact that Peggy knows x. There's that footnote about how r must be truly random, of course, but as long as everything's done right there is no additional information there whatsoever, only random noise.

Side note: one thing I certainly don't understand are NI-ZK - while I think I have some rough understanding of how interactive ZK proofs work - well, I mean, I've read Quisquater et al.'s "How to explain zero-knowledge protocols to your children" - but I'm pretty clueless how they manage to make such things non-interactive.


Any information exchange must go through a medium and it's not possible to create one with zero metadata.


Oh, I think I see your point now. But I think it's a weird argument, to be honest.

I suppose the fact that it's Peggy and Victor who are running that protocol is simply irrelevant. They're talking about that value of x after all, and nothing related to that topic is revealed beyond the proof of the fact that Peggy knows it. If she'd appear in person, wherever she wears a red shirt or a white one would be might be considered "information" but it would be completely out of scope.


Finally, a way to secretly confess my love for justice and world peace.


Very nice! but it's not a zero-knowledge application at all


Lol, sending someone the link kind of defeats the purpose, no?


I think this was originally a joke on a MIT Facebook page.


This is not the usual notion of zero-knowledge.


Would a double SHA256 hash make it securer?


Interesting but I'm too old for this.


This is perfect for this generation.


What if you love hashes?


Pretty clever IMO


Poor John Smith.


Nothing says romance like a sha-256 hash. Neruda,take notes.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: