www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Is there a way i can generate TOTP in Dlang.

reply Sudhi <sudheendra.malli gmail.com> writes:
Hi All,

I am trying to generate TOTP using a secret key in DLang. I want 
to use this on server side which is written using DLang.

Could some one help me on how to generate TOTP using openssl or 
botan or any other crypto library.
Oct 14 2019
next sibling parent reply Jacob Carlborg <doob me.com> writes:
On Tuesday, 15 October 2019 at 06:19:57 UTC, Sudhi wrote:
 Hi All,

 I am trying to generate TOTP using a secret key in DLang. I 
 want to use this on server side which is written using DLang.

 Could some one help me on how to generate TOTP using openssl or 
 botan or any other crypto library.
There's a package available for Botan here [1] and bindings to OpenSSL here [2]. Although I don't know how to use them for this. [1] https://code.dlang.org/packages/botan [2] https://github.com/D-Programming-Deimos/openssl -- /Jacob Carlborg
Oct 15 2019
parent Sudhi <sudheendra.malli gmail.com> writes:
On Tuesday, 15 October 2019 at 14:31:08 UTC, Jacob Carlborg wrote:
 On Tuesday, 15 October 2019 at 06:19:57 UTC, Sudhi wrote:
 Hi All,

 I am trying to generate TOTP using a secret key in DLang. I 
 want to use this on server side which is written using DLang.

 Could some one help me on how to generate TOTP using openssl 
 or botan or any other crypto library.
There's a package available for Botan here [1] and bindings to OpenSSL here [2]. Although I don't know how to use them for this. [1] https://code.dlang.org/packages/botan [2] https://github.com/D-Programming-Deimos/openssl -- /Jacob Carlborg
I went through the API and documentation of both these packages, did not see any mentions of TOTP in that.
Oct 19 2019
prev sibling parent reply Andre Pany <andre s-e-a-p.de> writes:
On Tuesday, 15 October 2019 at 06:19:57 UTC, Sudhi wrote:
 Hi All,

 I am trying to generate TOTP using a secret key in DLang. I 
 want to use this on server side which is written using DLang.

 Could some one help me on how to generate TOTP using openssl or 
 botan or any other crypto library.
Hi, I am not an expert at all in this area, but what I understand from the related RFCs for TOTP and HOTP is that you need HMAC SHA1. This functionality is already included in Phobos. Therefore you do not need openssl or botan but "just" implement the algorithm as explained here https://tools.ietf.org/html/rfc4226 Kind regards Andre
Oct 15 2019
parent Sudhi <sudheendra.malli gmail.com> writes:
On Tuesday, 15 October 2019 at 18:29:38 UTC, Andre Pany wrote:
 On Tuesday, 15 October 2019 at 06:19:57 UTC, Sudhi wrote:
 Hi All,

 I am trying to generate TOTP using a secret key in DLang. I 
 want to use this on server side which is written using DLang.

 Could some one help me on how to generate TOTP using openssl 
 or botan or any other crypto library.
Hi, I am not an expert at all in this area, but what I understand from the related RFCs for TOTP and HOTP is that you need HMAC SHA1. This functionality is already included in Phobos. Therefore you do not need openssl or botan but "just" implement the algorithm as explained here https://tools.ietf.org/html/rfc4226 Kind regards Andre
Thanks Andre, I will try this.
Oct 19 2019