Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suggestion: Hash a combination of the two names #7

Open
FlorentCLMichel opened this issue Jun 4, 2022 · 1 comment
Open

Suggestion: Hash a combination of the two names #7

FlorentCLMichel opened this issue Jun 4, 2022 · 1 comment

Comments

@FlorentCLMichel
Copy link

First, thanks a lot for making this website and the code open-source! It's a very fun way to illustrate one of the applications of hash functions!

I have a small suggestion to further reduce the amount of information that can be extracted from the hash. If I am correct, the hash is calculated from the crush's name only. So, if two people, say Archibald and Bob, have the same crush, say Charlene Randomfamilyname, both will get the same hash Hash("Charlene Randomfamilyname"). Someone who can see the two hashes thus knows that Archibald and Bob have the same crush. (Or, at least, that the names of their crushes have the same hash, which, if the probability of collision is small enough, means they have the same name with very high probability.)

One possible solution would be to hash a combination of the user's name and that of the crush. In this example, the two hashes would be Hash("Archibald Charlene Randomfamilyname") and Hash("Bob Charlene Randomfamilyname"). Anyone who does not know the name of Archibald's nor Bob's crush would then be able to tell whether they have the same crush without a brute-force attack (assuming, of course, that the hash function and its implementation are secure).

@HanSeoulOh
Copy link

I think probably it should be something like Hash("yourname" XOR "theirname") but either way it is still vulnerable to a dictionary attack if you knew either "yourname" or "theirname" as a dictionary could be easily compiled from their social media account.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants