Implements two-step verification of HOTP/TOTP
Project description
otpauth is One Time Password Authentication, which is usually called as two steps verification. You may have heard it from Google, Dropbox and etc.
Installation
Installing otpauth is simple with pip:
$ pip install otpauth
or, with easy_install:
$ easy_install otpauth
Usage
Generate and validate an otp code is very simple:
>>> from otpauth import OtpAuth >>> auth = OtpAuth('secret') # a secret string >>> auth.hotp() # generate a count based code, default count is 4 330810 >>> auth.valid_hotp(330810) 4 >>> auth.hotp(2) # generate a count based code, count is 2 720111 >>> auth.valid_hotp(720111) 2 >>> auth.totp() # generate a time based code 828657 >>> auth.valid_totp(828657) True
Authenticator
You can create a QR code for Google Authenticator to scan:
>>> from otpauth import OtpAuth >>> auth = OtpAuth('secret') # a secret string >>> s = auth.to_uri('totp', 'Example:foo@bar.baz', 'Foo') >>> import qrcode >>> img = qrcode.make(s)
Since Google Authenticator was not maintained well. There is a good replacement: Duo Mobile.
You should try this one.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
otpauth-0.3.0.tar.gz
(4.6 kB
view details)
Built Distribution
File details
Details for the file otpauth-0.3.0.tar.gz
.
File metadata
- Download URL: otpauth-0.3.0.tar.gz
- Upload date:
- Size: 4.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2b1296d3f6104c79c117f6c483f31f3fba853cbaf985a22a8f3bcfc11008880f |
|
MD5 | 4e3b6d63aae22ad6cb326a53db1a7670 |
|
BLAKE2b-256 | 0b0ef91bd104443e9f8ff77d7a8e173f62696ee248088e925afc82c41b6c4620 |
File details
Details for the file otpauth-0.3.0-py2.py3-none-any.whl
.
File metadata
- Download URL: otpauth-0.3.0-py2.py3-none-any.whl
- Upload date:
- Size: 5.3 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0a4c9540668169ba63aefd83311990d902ce8af38a620e5da583622cf27f3aa4 |
|
MD5 | 5101757f9558f0fe12370b6a10e9ee93 |
|
BLAKE2b-256 | ec04cf127292b71b6c9450ab5458d08b2e91592412e021c0f6ea4fdaf84b4853 |