https://github.com/ccubed/otpy
Python 3 OTP Implementations
https://github.com/ccubed/otpy
hotp otp python python-3 rfc2289 rfc4226 rfc6238 totp
Last synced: about 1 year ago
JSON representation
Python 3 OTP Implementations
- Host: GitHub
- URL: https://github.com/ccubed/otpy
- Owner: ccubed
- License: mit
- Created: 2017-03-01T02:28:56.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2017-03-06T12:23:40.000Z (over 9 years ago)
- Last Synced: 2025-02-02T08:45:12.035Z (over 1 year ago)
- Topics: hotp, otp, python, python-3, rfc2289, rfc4226, rfc6238, totp
- Language: Python
- Size: 10.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://travis-ci.org/ccubed/Gwiriwyd)
# OTPy
I needed to handle One Time Passwords per RFC 4226, 6238 and 2289, but all the libraries on pypi were not valid and returned invalid values per the tests present in the Appendices. Therefore, I set about making my own.
## Thanks
Thanks to [Laura](https://github.com/SunDwarf) for the name.
# Current Status
## RFC 2289 - OTP
Implemented. Only supports MD4 and MD5.
## RFC 4226 - HOTP
Implemented. All tests complete good per the test values in Appendix D of RFC 4426.
## RFC 6238 - TOTP
Partially Implemented. Only supports SHA1 at the moment, but all unit tests completed successfully per the test values in the Appendix.
# Guarantees
## Provide a verification method
All implementations provide a method to verify a key given a specific set of values.
## Provide an at method
Another problem I found with other libraries is that some failed to provide an `at` method. A method which would accept a specific counter or pass phrase and return the result.
## Type Consistency
All the codes are turned as strings so that we don't strip leading zeros.
## Provide a drift method
I only found one implementation with a drift method, even though it's specified in all 3 RFCs that one should exist. You'll find mine conveniently named drift. Mostly for accepting codes, this allows you to easily generate a range of codes so that you can compensate for latency per RFC recommendations.