Generate Qr Code From Secret Key
10.12.2020 admin
Google authenticator (base32) and OATH (hex) TOTP QR code generator


Qr Code Generator Free Google
gistfile1.txt
Generate Qr Code From Secret Keys
You will need to copy the text string as well as scan the QR code. Click enter your secret key manuallyand copy the text of the code and paste it into a text file now. Be sure to save a copy of the secret key. You can use this to create a backup copy of your YubiKey configured to use authenticator codes. Essl free licence key generator. Jul 07, 2015 Google authenticator (base32) and OATH (hex) TOTP QR code generator - gist:0db99a45872d4bfc4dc9. Google authenticator (base32) and OATH (hex) TOTP QR code generator - gist:0db99a45872d4bfc4dc9. Windows 8 key generator cmd text file. KEY SECRET, BASE 32. #'Myphone nr' for example, but it can be anything, a login/uid, etc. Keyname = ' #if you want to generate a code.
Qr Code Convert
#!/usr/bin/env python |
# This Source Code Form is subject to the terms of the Mozilla Public |
# License, v. 2.0. If a copy of the MPL was not distributed with this |
# file, You can obtain one at http://mozilla.org/MPL/2.0/. |
# Required packages (available from pip) : pyqrcode, pypng |
importpyqrcode |
importbase64 |
importos |
importbinascii |
#We want a secret of at least 30 hex chars for security reasons |
SECRET_LEN=30 |
defconvert_secret_to_base32(secret): |
returnbase64.b32encode(base64.b16decode(secret.upper())) |
# Google authenticator format: |
#otpauth://totp/[KEY NAME]?secret=[KEY SECRET, BASE 32]. |
#'Myphone nr' for example, but it can be anything, a login/uid, etc. |
keyname='4155701111' |
#if you want to generate a code for non-Google (ie standard OATH Hex secret): |
#secret = binascii.b2a_hex(os.urandom(SECRET_LEN)) |
#For Google or Google-compatible authenticators: |
secret=convert_secret_to_base32(binascii.b2a_hex(os.urandom(SECRET_LEN))) |
#For HOTP, just replace totp by hotp ;-) |
qrdata='otpauth://totp/{keyname}?secret={secret}'.format(keyname=keyname, secret=secret) |
code=pyqrcode.create(qrdata) |
# Generate on disk |
code.png('code.png', scale=10) |
# Generate in memory example: |
# import io |
# buffer = io.BytesIO() |
# url.png(buffer) |
# print('<img data='{}' />'.format(buffer.getvalue(()))) |
Generate Qr Code From Secret Key Code
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment