Skip to main content

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


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.2.1.tar.gz (26.4 kB view details)

Uploaded Source

Built Distribution

otpauth-2.2.1-py3-none-any.whl (6.4 kB view details)

Uploaded Python 3

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

Hashes for otpauth-2.2.1.tar.gz
Algorithm Hash digest
SHA256 169a7adbd715fca687f6a66d02ccdbefc229fb49f8a634b958d286f908134d59
MD5 7cb828678908423e61a4e6bdf426b04c
BLAKE2b-256 4799e6c2adda32cc969b0b7c762e17c53575db5a31e4d55e08dee36c0f801573

See more details on using hashes here.

Provenance

The following attestation bundles were made for otpauth-2.2.1.tar.gz:

Publisher: pypi.yml on authlib/otpauth

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

Hashes for otpauth-2.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 b7eabe0ed91cb67eb3054b7f517e4b4a7495fb30eaf2951897d41c8feef5de73
MD5 0d64b7f2e5dafc947033c50a73bd7fde
BLAKE2b-256 752cbc109eade0af850d38837b9835f812d8a8bcad1269bbcbdc136deb9fed30

See more details on using hashes here.

Provenance

The following attestation bundles were made for otpauth-2.2.1-py3-none-any.whl:

Publisher: pypi.yml on authlib/otpauth

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page