Python Onetime Password Authentication
By Cody, Published on 3 years ago, 842 Views
Tags : #python_onetimepass #otp #google_authenticator_code #otp_code #offline_otp
onetimepass is a Python module for generating and validating one-time passwords. It can be used for both time-based passwords, as well as passwords invalidated after first use. Module for generating and validating HOTP and TOTP tokens
Installation -
pip install onetimepass
OneTimePass (actually onetimepass) is a module for generating one-time passwords, namely HOTPs (HMAC-based one-time passwords) and TOTPs (time-based one-time passwords). They are used eg. within Google Authenticator application for Android or iPhone.
pip install onetimepass
To get time-based token
import onetimepass as otp
my_secret = 'MFRGGZDFMZTWQ2LK'
my_token = otp.get_totp(my_secret)
To get HMAC-based token
import onetimepass as otp
my_secret = 'MFRGGZDFMZTWQ2LK'
my_token = otp.get_hotp(my_secret, intervals_no=3)
Report Inappropriate content / Link not working ?