Skip to content

ccubed/OTPy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build Status

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 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.