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

30
bcrypter/debug.py Normal file
View file

@ -0,0 +1,30 @@
from math import gcd
from random import randint, randbytes
def main() -> None:
if debug_test_random_hashes(10000) != None:
R_table = precompute_R(0, 255)
x = bytes(input('x: '), 'utf-8')
hash_test = hashfn(x, R_table)
hash_bcrypt = bcrypt(x)
print(f'hashfn: {hash_test}')
print(f'bcrypt: {hash_bcrypt}')
# a = bytes(input("A: "), 'utf-8')
# b = bytes(input("B: "), 'utf-8')
# if a != b and hashfn(a) == hashfn(b):
# print('*** YOU WIN ***')
# elif a == b:
# print('Idiot those are the same')
# else:
# print("Trivially false!")
if __name__ == '__main__':
try:
main()
except KeyboardInterrupt:
print('\n[!] Received SIGINT')
except EOFError:
print('\n[!] Reached EOF')