Under OTP, I showed with example how to generate an totp. By default the length of the totp generated will be 6. We can change that to any number between 6 and 8. In this post under OTP, I will show with example how to change totp length to 8. Below is the complete main…… Continue reading Changing the totp length
Tag: BastiaanJansen OTP
Verifying the TOTP
In this post, I will show with example how to verify TOTP. In my previous posts, under OTP I showed with example how to generate TOTP. To verify an TOTP we can use non-static overloaded “verify” methods in “TOTP” class. Below is the complete code for your reference. Main Class 1 package defaultPackage;2 3 import…… Continue reading Verifying the TOTP
Changing the algorithm when generating totp
In previous post, I showed with example how to generate an TOTP. I also mentioned in my previous post, how the framework by default using SHA-1 algorithm to generate the totp. In this post under OTP, I will show with example how to change the default algorithm. Below is the code for your reference. 1…… Continue reading Changing the algorithm when generating totp
Generating an TOTP
In this post I will show with example how to generate TOTP. TOTP is based on HOTP but instead of using counter, TOTP uses the current time as the counter in addition to secret key So TOTP = HOTP(secret key, current time). Similar to HOTP in client server scenario both client and server has to…… Continue reading Generating an TOTP
Changing the hotp length
Under OTP, I showed with example how to generate an hotp. By default the length of the hotp generated will be 6. We can change that to any number between 6 and 8. In this post under OTP, I will show with example how to change hotp length to 8. Below is the complete main…… Continue reading Changing the hotp length
Verifying the HOTP
In this post, I will show with example how to verify HOTP. In my previous posts, under OTP I showed with example how to generate HOTP. To verify an HOTP we can use non-static overloaded “verify” methods in “HOTP” class. Below is the complete code for your reference. Main Class 1 package defaultPackage;2 3 import…… Continue reading Verifying the HOTP
Changing the algorithm when generating hotp
In previous post, I showed with example how to generate an HOTP. I also mentioned in my previous post, how the framework by default using SHA-1 algorithm to generate the otp. I this post under OTP, I will show with example how to change the default algorithm. Below is the code for your reference. Main…… Continue reading Changing the algorithm when generating hotp
Generating HOTP example
In this post I will show with example how to generate HOTP. I will be using open source otp framework written by “BastiaanJansen” using Java programming language. Below is the link to the GitHub project https://github.com/BastiaanJansen/otp-java HOTP is generated using two input parameters1) a secret2) a counter Below is the main method that shows how…… Continue reading Generating HOTP example