Coder Social home page Coder Social logo

zenprojects / ocrajs Goto Github PK

View Code? Open in Web Editor NEW
6.0 2.0 3.0 43 KB

OCRA: OATH Challenge-Response Algorithm implementation in Javascript

Home Page: http://zenprojects.github.io/OCRAjs

License: GNU General Public License v3.0

JavaScript 95.72% HTML 4.28%
hotp ocra javascript authentication two-factor-authentication two-factor

ocrajs's Introduction

OCRAjs - OCRA: OATH Challenge-Response Algorithm implementation in Javascript

This project contains example implementations of the OATH OCRA Challenge Response algorithm for Javascript based RFC 6287.

This implementation are based on the reference implementation from the official OCRA specification.

The current version of the OCRA standard can be found here:

http://tools.ietf.org/html/rfc6287

Use

The ocra suite format are defined in rfc 6287 at §6

var ocraSuite = "OCRA-1:HOTP-SHA1-6:QN08";
var SEED   = "3132333435363738393031323334353637383930";
var ocra = OCRA.generateOCRA( ocraSuite,          // ocra suite
                              seed,               // shared secret key
                              counter,            // ocra counter 
                              question,           // question in hex string format
                              password,           // password string hash
                              sessionInformation, // session information 
                              timeStamp);         // timestamp 
alert(ocra);  // ocra result

Test Unit

This Javascript implementation are accompanied by a unit test that validates the implementation against the test vectors from the RFC.

Clic her to test with SJCL HAMC-SHA engine to execute test.

Clic her to test with jsSHA HAMC-SHA engine to execute test.

And compare with reference test vector.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.