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.0.tar.gz
(6.1 kB
view details)
Built Distribution
File details
Details for the file otpauth-2.1.0.tar.gz
.
File metadata
- Download URL: otpauth-2.1.0.tar.gz
- Upload date:
- Size: 6.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.11.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4bdeedbb6fa49164591f30761110758bd7bd55a5c902b9913b7b94f4c53b9c4c |
|
MD5 | e9f5f197dedea3f765aab28a4f884bff |
|
BLAKE2b-256 | c92ac4ae602c7f7a1bf8ec71b2bb02f27834037c2feafd45d33844a1c610af30 |
File details
Details for the file otpauth-2.1.0-py3-none-any.whl
.
File metadata
- Download URL: otpauth-2.1.0-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.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3bf0d28de7bfc1b96ad237d6749f85306ce6f49ca38f0f5c12ec81ad7d9260d9 |
|
MD5 | 8c725f99e6bde0f21d40c46476a17315 |
|
BLAKE2b-256 | a85edd2c8140d0b28f51d0077f58bc302baf4ad7afae2dfa1fda208bfa6a59db |