Created
October 23, 2016 15:47
-
-
Save perpetual-hydrofoil/b4c1794ea2f8bf68f861fc6f3567f55d to your computer and use it in GitHub Desktop.
TOTP Generator Example (howto)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/python | |
# sudo pip install otpauth first | |
import time | |
from otpauth import OtpAuth | |
__doc__ = """ | |
This can be useful as an example of how to | |
build your own CLI google auth app. | |
Use your QR code reader to extract the secret | |
and then save it somewhere safe (obviously) | |
This will display an updated TOTP every two seconds: | |
""" | |
secret = raw_input('Please provide secret: ').strip() | |
auth = OtpAuth(secret) | |
while True: | |
print '%s' % auth.totp() | |
time.sleep(.2) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment