This implementation are based on the reference implementation from the official OCRA specification.
The current version of the OCRA standard can be found here:
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
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.