continued reorganisation

This commit is contained in:
Emile Clark-Boman 2025-06-21 21:29:00 +10:00
parent 6f8a7322f2
commit 0a2d9a5694
22 changed files with 190 additions and 61 deletions

15
bcrypter/hash/og.py Normal file
View file

@ -0,0 +1,15 @@
'''
The unchanged original "bcrypt" function for the CTF (by bpaul)
'''
def bcrypt(x: bytes) -> int:
h = 18446744073709551614
for (i, b) in enumerate(x):
h *= h * (b + 1)
k = 59275109328752 * (i + 1)
for j in range(8):
k ^= b << (j * j)
h += k
h %= (2 ** 64)
return h