Skip to content

First release of Time-Base One-Time Password Algorithm Library. Allows generation and validation of time-based authentication codes as well as provides compatibility with Google Authenticator application and can generate URL to QR codes that can be scanned for easy data entry.

It is also very easy to use:

TOTP totp = new TOTP();

byte[] secret = TOTPSecret.generate();

String encoded = TOTPSecret.encode(secret);
String qr = GoogleAuthenticator.getQRUrl("jdoe", "", encoded);

byte[] decoded = TOTPSecret.decode(key);
int code = totp.generate(secret);
boolean valid = totp.validate(decoded, code);

Demo available for preview at:

Assets 3
You can’t perform that action at this time.