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
Built Distribution
File details
Details for the file otpauth-2.2.1.tar.gz
.
File metadata
- Download URL: otpauth-2.2.1.tar.gz
- Upload date:
- Size: 26.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 169a7adbd715fca687f6a66d02ccdbefc229fb49f8a634b958d286f908134d59 |
|
MD5 | 7cb828678908423e61a4e6bdf426b04c |
|
BLAKE2b-256 | 4799e6c2adda32cc969b0b7c762e17c53575db5a31e4d55e08dee36c0f801573 |
Provenance
The following attestation bundles were made for otpauth-2.2.1.tar.gz
:
Publisher:
pypi.yml
on authlib/otpauth
-
Statement:
- Statement type:
https://in-toto.io/Statement/v1
- Predicate type:
https://docs.pypi.org/attestations/publish/v1
- Subject name:
otpauth-2.2.1.tar.gz
- Subject digest:
169a7adbd715fca687f6a66d02ccdbefc229fb49f8a634b958d286f908134d59
- Sigstore transparency entry: 209202450
- Sigstore integration time:
- Permalink:
authlib/otpauth@2587e4a40c15a4c2b3d7cf2bb79bb833ea4d1e76
- Branch / Tag:
refs/tags/v2.2.1
- Owner: https://github.com/authlib
- Access:
public
- Token Issuer:
https://token.actions.githubusercontent.com
- Runner Environment:
github-hosted
- Publication workflow:
pypi.yml@2587e4a40c15a4c2b3d7cf2bb79bb833ea4d1e76
- Trigger Event:
push
- Statement type:
File details
Details for the file otpauth-2.2.1-py3-none-any.whl
.
File metadata
- Download URL: otpauth-2.2.1-py3-none-any.whl
- Upload date:
- Size: 6.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b7eabe0ed91cb67eb3054b7f517e4b4a7495fb30eaf2951897d41c8feef5de73 |
|
MD5 | 0d64b7f2e5dafc947033c50a73bd7fde |
|
BLAKE2b-256 | 752cbc109eade0af850d38837b9835f812d8a8bcad1269bbcbdc136deb9fed30 |
Provenance
The following attestation bundles were made for otpauth-2.2.1-py3-none-any.whl
:
Publisher:
pypi.yml
on authlib/otpauth
-
Statement:
- Statement type:
https://in-toto.io/Statement/v1
- Predicate type:
https://docs.pypi.org/attestations/publish/v1
- Subject name:
otpauth-2.2.1-py3-none-any.whl
- Subject digest:
b7eabe0ed91cb67eb3054b7f517e4b4a7495fb30eaf2951897d41c8feef5de73
- Sigstore transparency entry: 209202458
- Sigstore integration time:
- Permalink:
authlib/otpauth@2587e4a40c15a4c2b3d7cf2bb79bb833ea4d1e76
- Branch / Tag:
refs/tags/v2.2.1
- Owner: https://github.com/authlib
- Access:
public
- Token Issuer:
https://token.actions.githubusercontent.com
- Runner Environment:
github-hosted
- Publication workflow:
pypi.yml@2587e4a40c15a4c2b3d7cf2bb79bb833ea4d1e76
- Trigger Event:
push
- Statement type: