Thread overview
Is there a way i can generate TOTP in Dlang.
Oct 15, 2019
Sudhi
Oct 15, 2019
Jacob Carlborg
Oct 20, 2019
Sudhi
Oct 15, 2019
Andre Pany
Oct 20, 2019
Sudhi
October 15, 2019
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.
October 15, 2019
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
October 15, 2019
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
October 20, 2019
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.
October 20, 2019
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.