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

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

otpauth-2.2.0-py3-none-any.whl (6.3 kB view details)

Uploaded Python 3

File details

Details for the file otpauth-2.2.0.tar.gz.

File metadata

  • Download URL: otpauth-2.2.0.tar.gz
  • Upload date:
  • Size: 26.3 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.0.tar.gz
Algorithm Hash digest
SHA256 12fdae64d0664ffbfafdadfdc1ec8fe571acd0e71a62f79233dd3bda088d39c2
MD5 fcb515c9b8317576a8bdd08b27f1d597
BLAKE2b-256 81f72acb4a01fe3e2c48cafc27badf2b9de5f7a35482281ba83e9dec00dd5355

See more details on using hashes here.

Provenance

The following attestation bundles were made for otpauth-2.2.0.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.0-py3-none-any.whl.

File metadata

  • Download URL: otpauth-2.2.0-py3-none-any.whl
  • Upload date:
  • Size: 6.3 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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 cbedbbf0618687ac4bddbc033d95a42b0e4d78a843a106806e79eb4e97354f11
MD5 35549f72ae4bbb32aa0d32c5d4ec6bdf
BLAKE2b-256 5c9e54780822f127d5ad6386e6ceb3d87d6e342839941aa31b21516030d4a1df

See more details on using hashes here.

Provenance

The following attestation bundles were made for otpauth-2.2.0-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 Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page