Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

authlib/otpauth

Open more actions menu

Repository files navigation

OTP Auth logo

One time password implementations in Python. HOTP and TOTP.

Github Actions PyPI codecov Maintainability Rating Security Rating

Usage

A quick and simple usage of 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

Install

Install with pip:

pip install otpauth

Useful links

Copyright

2013, Hsiaoming Yang. Under BSD-3 license.

About

Implements two-step verification of HOTP/TOTP. Also known as one time password.

Topics

Resources

License

Security policy

Stars

Watchers

Forks

Sponsor this project

  •  
  •  

Contributors 8

Morty Proxy This is a proxified and sanitized view of the page, visit original site.