Page 1 of 1

TOTP aka Time Based One Time Password.

Posted: Tuesday 6th December 2022 5:19pm
by dockfo
Hello. This is my first post, greetings to everyone !!!. I wrote a small class that can be used mostly with web based applications and it utilizes the time based one time password creation. The algorithm that produces the codes is extensively explained in this video https://www.youtube.com/watch?v=VOYxF12K1vE&t=487s. The class I wrote basically utilizes the concept in this video. It is far from perfect but it is usable (I have to confess that I am not a professional programmer :o ). The class has 1 property 'SecretLenght' and three methods 'GetSecret', 'GetQRCode', and 'Verify' which are self explanatory. Embed the class in your web based project, instantiate the class with for example auth = new TOTP and use it accordingly.I have included an example of the use of the class. Because it is a web based application don't forget to enable the 'Use embedded HTTP server' support in configuration menu.
I hope the class will be useful to someone !!!
TOTP.png
TOTP.png (72.4 KiB) Viewed 5068 times

Re: TOTP aka Time Based One Time Password.

Posted: Wednesday 7th December 2022 4:43pm
by cogier
Hi docfo and welcome to the forum.

I had a look at your program. It looks very good, but is very specialized. What plans do you have for such security?

Re: TOTP aka Time Based One Time Password.

Posted: Wednesday 7th December 2022 8:30pm
by dockfo
Thanks cogier. Well, I am in the middle of writing a web based application and I had to add an extra attention to the security part because it will be a real production website. I have finished the log in system with remember-me cookie and so, and the 2 factor authentication is a part of it. I thought that it would be nice if someone else would like to include this kind of functionality to his project. :mrgreen: