Introducing Node One Time Password library. 2 Step verification for NodeJS. Works with Google Authenticator.

1,289 views
Skip to first unread message

Guy Halford-Thompson

unread,
Oct 3, 2011, 11:38:33 AM10/3/11
to nod...@googlegroups.com
Hi All,

I would like to introduce Node One Time Password (notp). This library
brings you the power of counter based one time passwords (HOTP) and
time based one time passwords (TOTP) to NodeJS. It is fully compliant
with RFC 4226 (http://tools.ietf.org/html/rfc4226) and RFC 6238
(http://tools.ietf.org/html/rfc6238), giving you very secure 2 step
authentication for your NodeJS apps.

It is designed to work with Google Authenticator
(http://code.google.com/p/google-authenticator/) that has apps for
iOS, Android and Blackberry.

The library has ZERO dependencies and is very simple to use.

Check out https://github.com/guyht/notp

Installation via
npm install notp

Example usage for TOTP

var notp = require('notp'),
args = {
K : '12345678901234567890'
},
b32 = notp.encBase32(args.K);

console.log('Getting current counter value for K = 12345678901234567890');
console.log('This has a base32 value of ' + b32);
console.log('The base32 value should be entered in the Google
Authenticator App');
console.log('');

notp.getTOTP(args,
function(err) { console.log(err); },
function(code) {
console.log('The current TOTP value is ' + code);
}
);


Now open to questions....

--
Guy Halford-Thompson
Blog                  - http://www.cach.me/blog
Twitter               - https://twitter.com/mrwooster
Google Plus       - http://gplus.name/guy

dvbportal

unread,
Oct 3, 2011, 12:01:00 PM10/3/11
to nod...@googlegroups.com
Nice one. I added two-factor authentication to all my servers just a few days ago. For now the solution is Ruby-based, but I am going to give your module a try.

Guy Halford-Thompson

unread,
Oct 3, 2011, 8:59:47 PM10/3/11
to nod...@googlegroups.com
This implementation is loosely based around the Ruby rotp implementation.

> --
> Job Board: http://jobs.nodejs.org/
> Posting guidelines:
> https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
> You received this message because you are subscribed to the Google
> Groups "nodejs" group.
> To post to this group, send email to nod...@googlegroups.com
> To unsubscribe from this group, send email to
> nodejs+un...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/nodejs?hl=en?hl=en

Reply all
Reply to author
Forward
0 new messages