Two-Factor Auth in Go

1,335 views
Skip to first unread message

Sanjay

unread,
Apr 21, 2013, 1:58:12 AM4/21/13
to golan...@googlegroups.com
Hello Gophers,

I've had an implementation of the Two-Factor Auth algorithm that Google Authenticator implements lying around for a while now. I took some time to polish it up a little and open-source it: https://github.com/balasanjay/totp

Docs can be found at the usual place: http://godoc.org/github.com/balasanjay/totp

Hope it's useful!

Cheers,
Sanjay

Archos

unread,
Apr 21, 2013, 4:58:51 AM4/21/13
to golan...@googlegroups.com
Could you add authentication with HMAC + SHA-2 family ?

Sanjay

unread,
Apr 21, 2013, 5:07:26 AM4/21/13
to golan...@googlegroups.com
For interoperability with Google Authenticator, the default is SHA1 + HMAC. But you're free to plug in your own hash function, see the Hash field in the Options struct. In fact, the tests include all the values from the RFC's test table, including samples from {SHA1, SHA256, SHA512}. 

Note that if you do use something from the SHA2 family, then you will also have to write your own authenticator app, since GA's will not work for you.

Sanjay

Péter Szilágyi

unread,
Apr 21, 2013, 7:21:59 AM4/21/13
to Sanjay, golang-nuts
Ok, sorry, I'm stupid... it was HKDF, was to eager to reply... forget it, sorry. :))


On Sun, Apr 21, 2013 at 1:21 PM, Péter Szilágyi <pet...@gmail.com> wrote:
HMAC is currently under review to be included in the Go.crypto packages, but you'll have to wait till after Go 1.1 is released.



Sanjay

--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 


Péter Szilágyi

unread,
Apr 21, 2013, 7:21:33 AM4/21/13
to Sanjay, golang-nuts
HMAC is currently under review to be included in the Go.crypto packages, but you'll have to wait till after Go 1.1 is released.

On Sun, Apr 21, 2013 at 11:07 AM, Sanjay <balas...@gmail.com> wrote:
Sanjay

--

Damian Gryski

unread,
Apr 21, 2013, 7:57:02 AM4/21/13
to golan...@googlegroups.com
I've also implemented a Google Authenticator library. I tried to match the functionality of the PAM module, so it includes counter-based codes, time-based codes with configurable window-sizes, and scratch codes.

https://github.com/dgryski/dgoogauth

Reply all
Reply to author
Forward
0 new messages