Created
November 21, 2018 07:39
-
-
Save aaronyoo/414cc09133a6325434b9b6076e3698dc to your computer and use it in GitHub Desktop.
The birthday attack portion of the CictroHash
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
birthday_dict = {} | |
while (True): | |
pre = "".join(random.choices(string.ascii_letters + string.digits, k = random.randint(1, 5))) | |
hash_val = hash(pre) | |
if (hash_val in birthday_dict and birthday_dict[hash_val] != pre): | |
print(pre, birthday_dict[hash_val]) | |
else: | |
birthday_dict[hash_val] = pre |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment