A simple Java OTP (One Time Password) generator library, currently supports RFC standard time based and counter based algorithms.
Latest commit 9f947e2 Aug 20, 2012 @kamranzafar updated doc
Failed to load latest commit information.
src updated testcase Aug 20, 2012
.gitignore first commit Aug 20, 2012
LICENSE.txt first commit Aug 20, 2012
README.md updated doc Aug 20, 2012
pom.xml first commit Aug 20, 2012


Using libotp

libotp is a simple java One-time password generator library, which can easily be used to facilitate two-factor authentication in Java applications. The library current supports the standard RFC counter based (hotp) and time based (totp) algorithms. Custom OTP providers can also be written by implementing the OTPProvider interface.


Below is an example of generating time-based password

OTP.generate("12345678", "" + System.currentTimeMillis(), 6, "totp")

Following is an example of counter-based password

OTP.generate("helloworld", "2", 6, "hotp")