summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephen Shkardoon <ss23@ss23.geek.nz>2019-10-24 12:33:14 +0200
committerStephen Shkardoon <ss23@ss23.geek.nz>2019-10-24 12:33:14 +0200
commit9cd9d0d1d67849f26ddd0c0530749c5e2abb0d88 (patch)
tree4533b7c315e677f1937f76727c1118575cbb602c
parentAdd OpenCL version of QR cracker (reference) (diff)
downloadentrust-identityguard-tools-9cd9d0d1d67849f26ddd0c0530749c5e2abb0d88.tar
entrust-identityguard-tools-9cd9d0d1d67849f26ddd0c0530749c5e2abb0d88.tar.gz
entrust-identityguard-tools-9cd9d0d1d67849f26ddd0c0530749c5e2abb0d88.tar.bz2
entrust-identityguard-tools-9cd9d0d1d67849f26ddd0c0530749c5e2abb0d88.tar.lz
entrust-identityguard-tools-9cd9d0d1d67849f26ddd0c0530749c5e2abb0d88.tar.xz
entrust-identityguard-tools-9cd9d0d1d67849f26ddd0c0530749c5e2abb0d88.tar.zst
entrust-identityguard-tools-9cd9d0d1d67849f26ddd0c0530749c5e2abb0d88.zip
-rwxr-xr-xcrack-otp.py11
1 files changed, 10 insertions, 1 deletions
diff --git a/crack-otp.py b/crack-otp.py
index ea958bd..2d27fb9 100755
--- a/crack-otp.py
+++ b/crack-otp.py
@@ -29,6 +29,15 @@ activation = activation[0:-1] # remove last digit -- check digit
activationbytes = int(activation).to_bytes(7, byteorder='big')
logging.info("Activation bytes: 0x%s", activationbytes.hex())
+# Determine the number of digits in the OTP and set the format accordingly
+digitlen = len(args.OTP[0])
+if digitlen == 6:
+ digitformat = "dec6"
+elif digitlen == 8:
+ digitformat = "dec8"
+else:
+ logging.fatal("Failed to determine format of OTP.")
+
keys = []
timeToSearch = []
@@ -68,7 +77,7 @@ for otpTime in timeToSearch:
)
# Verify whether the output is valid for the given time
- otp = totp(key.hex(), hash=hashlib.sha256, t=otpTime)
+ otp = totp(key.hex(), hash=hashlib.sha256, t=otpTime, format=digitformat)
if otp == args.OTP[0]:
print("Possibe valid OTP seed found: ", key.hex())