Implements one time password of HOTP/TOTP
Project description
One time password implementations in Python. HOTP and TOTP.
Documentation: https://otp.authlib.org/ GitHub: https://github.com/authlib/otpauth
Usage
Most of the time, you would use a time based one time password. You can generate and verify the token with HOTP:
import otpauth totp = otpauth.HOTP(b"user-secret") # generate a code for now code: int = totp.generate() # you may want to convert it to string str_code: str = totp.string_code(code) # verify the code totp.verify(code) # => True totp.verify(str_code) # => True
License
Licensed under BSD. Please see LICENSE for licensing details.
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-2.1.1.tar.gz
(6.1 kB
view details)
Built Distribution
File details
Details for the file otpauth-2.1.1.tar.gz
.
File metadata
- Download URL: otpauth-2.1.1.tar.gz
- Upload date:
- Size: 6.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.11.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e09ed63a01b35acd78b7bb0f981fdcdbd1d9d9c01be1a3e0d7024c65d0e74e2a |
|
MD5 | 7b7b96538efab2ee45a06474ea23b2d7 |
|
BLAKE2b-256 | 7c28bc2428f072cc3ceb9eecead6e41e2914fab4f0d00c1d5ad2e5f018eb080a |
File details
Details for the file otpauth-2.1.1-py3-none-any.whl
.
File metadata
- Download URL: otpauth-2.1.1-py3-none-any.whl
- Upload date:
- Size: 6.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.11.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b08d2bf30c0118e4d6f5bd41c5d537761d119c001da4b69cba0e0ae7b93d7793 |
|
MD5 | d383c960cd94c0cea0bf570d5f5e3abc |
|
BLAKE2b-256 | 267b37eb712ecf1c9472baff30eb16d1c87ea92e396312de3ac1962da22f3a3b |