实现HOTP/TOTP的一次性密码
项目描述
Python中的一次性密码实现。HOTP和TOTP。
文档: https://otp.authlib.org/ GitHub: https://github.com/authlib/otpauth
用法
大多数情况下,您会使用基于时间的单次密码。您可以使用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
许可协议
许可协议为BSD。请参阅LICENSE以获取许可详情。
项目详情
下载文件
下载适用于您平台的文件。如果您不确定选择哪个,请了解有关安装包的更多信息。
源分发
otpauth-2.1.1.tar.gz (6.1 kB 查看哈希值)
构建版本
otpauth-2.1.1-py3-none-any.whl (6.6 kB 查看哈希值)
关闭
otpauth-2.1.1.tar.gz的哈希值
算法 | 哈希摘要 | |
---|---|---|
SHA256 | e09ed63a01b35acd78b7bb0f981fdcdbd1d9d9c01be1a3e0d7024c65d0e74e2a |
|
MD5 | 7b7b96538efab2ee45a06474ea23b2d7 |
|
BLAKE2b-256 | 7c28bc2428f072cc3ceb9eecead6e41e2914fab4f0d00c1d5ad2e5f018eb080a |
关闭
otpauth-2.1.1-py3-none-any.whl的哈希值
算法 | 哈希摘要 | |
---|---|---|
SHA256 | b08d2bf30c0118e4d6f5bd41c5d537761d119c001da4b69cba0e0ae7b93d7793 |
|
MD5 | d383c960cd94c0cea0bf570d5f5e3abc |
|
BLAKE2b-256 | 267b37eb712ecf1c9472baff30eb16d1c87ea92e396312de3ac1962da22f3a3b |