From 999157d60e1979a188b9d0d33451f06fab07f254 Mon Sep 17 00:00:00 2001 From: xBytez Date: Wed, 2 Oct 2019 23:56:05 +0200 Subject: [PATCH] Don't ouput secret, count by default. Don't prepend token with "Code: " by default. --- duo_gen.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/duo_gen.py b/duo_gen.py index da92bc2..45a4b6e 100755 --- a/duo_gen.py +++ b/duo_gen.py @@ -13,12 +13,16 @@ secret = f.readline()[0:-1] offset = f.tell() count = int(f.readline()) -print("secret", secret) -print("count", count) +debug = False hotp = pyotp.HOTP(secret) -print("Code:", hotp.at(count)) +if debug: + print("secret", secret) + print("count", count) + print("code:", hotp.at(count)) +else: + print(hotp.at(count)) f.seek(offset) f.write(str(count + 1)) -f.close() +f.close() \ No newline at end of file