Skip to content

Instantly share code, notes, and snippets.

@aaronyoo
Created November 21, 2018 07:39
Show Gist options
  • Save aaronyoo/414cc09133a6325434b9b6076e3698dc to your computer and use it in GitHub Desktop.
Save aaronyoo/414cc09133a6325434b9b6076e3698dc to your computer and use it in GitHub Desktop.
The birthday attack portion of the CictroHash
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