Implements two-step verification of HOTP/TOTP
Project description
Installation
To install otpauth, simply:
$ pip install otpauth
Usage
Generate and validate an otp code is very simple:
>>> from otpauth import OtpAuth
>>> auth = OtpAuth('secret') # a secret string
>>> auth.hotp()
330810
>>> auth.valid_hotp(330810)
4
>>> auth.hotp(2)
720111
>>> auth.valid_hotp(720111)
2
>>> auth.totp() # a time based string
828657
>>> auth.valid_totp(828657)
True
Google 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_google('totp', 'Example:foo@bar.baz', 'Foo')
>>> import qrcode
>>> img = qrcode.make(s)
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.1.1.tar.gz
(4.0 kB
view details)
File details
Details for the file otpauth-0.1.1.tar.gz.
File metadata
- Download URL: otpauth-0.1.1.tar.gz
- Upload date:
- Size: 4.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
abb79d8383575ccd3dfeea348f173d021e1dfb494659f4196e0753a9ca7369b7
|
|
| MD5 |
5769775cbcffbe5092dd2e6d55f286fd
|
|
| BLAKE2b-256 |
249de7607f7a8c7df5a45ec7e2adac40994fe95b31bd24458b008df7e02b1e3a
|