https://github.com/estevaocm/j2fa-otp
Library for one-time passwords for two-factor authentication, supporting HOTP and TOTP.
https://github.com/estevaocm/j2fa-otp
2fa hotp otp totp totp-tfa
Last synced: 3 months ago
JSON representation
Library for one-time passwords for two-factor authentication, supporting HOTP and TOTP.
- Host: GitHub
- URL: https://github.com/estevaocm/j2fa-otp
- Owner: estevaocm
- License: bsd-2-clause
- Created: 2018-09-21T18:17:39.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2018-10-30T18:03:49.000Z (over 6 years ago)
- Last Synced: 2024-11-09T13:40:40.046Z (7 months ago)
- Topics: 2fa, hotp, otp, totp, totp-tfa
- Language: Java
- Homepage:
- Size: 87.9 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# j2fa-otp
Library for one-time passwords for two-factor authentication. Supports TOTP and HOTP.First of all, you will need to generate a random secret key, at least 20 bytes long.
You may call the included CryptoUtils.randomSeed(20) or use your own implementation.
The OTPAuthentication class provides the authentication services.
Simply instantiate with either the TOTP or the HOTP constructor,
then call setupPath() to get the setup address
(which can be codified as a QR matrix using the QRCode class).
After the client sets up their device, call password() to compute the passcode
and verify the user input.