Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import hashlib
- start = 0x10000000 # Start with a four byte hex literal.
- end = 0xffffffff
- # OTP from PCAP
- #b7519dbe34acf21e29e687c20b42b8805b4db9935bf7f73b352d1caccb02a566
- # SHA3-256 Hashed OTP
- hash1 = '8b34947f13ce9014bfeccb41861c4350ff7d3f1f7bb92f112a82b7a0c81af96d'
- # Loop through all possible 4-byte hex combinations, hash with sha3-256, and compare first 8 characters.
- for i in range(start, end +1):
- var = hashlib.sha3_256((format(i, 'x')).encode('utf-8'))
- var_hexdigest = var.hexdigest()
- if var_hexdigest[:8] == hash1[:8]:
- #if var_hexdigest == hash1:
- print('bytes:', format(i, 'x'), ' hash:', var_hexdigest)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement