Hmac sha1 don't give same output as Java implementation.
GoogleCodeExporter opened this issue · comments
Google Code Exporter commented
Hi,
I am trying to implement OCRA algorithm in Javascript using CryptoJS. I casted
code from Java to Javascript, replacing Hmac function by the one used in Crypto
JS.
The problem is that the generated hash using SHA1 algorithm is totally
different from the one given by the Java implementation.
You can find attach Java source and my Javascript source. Hope you will find
where the problem comes form. Just before to call the HMAC function i outputted
key and message in both version (Javascript, and Java) to ensure it is exactly
the same byte array, and it is actually.
Original issue reported on code.google.com by felix.vo...@gmail.com
on 23 Jun 2013 at 11:42
Attachments:
Google Code Exporter commented
It isn't obvious to me from your JavaScript output which HMAC is failing. It
would be much simpler if you could provide: "Using hasher H, message M, and key
K, I expect to get output X, but I actually get Y." Also, make sure to mention
which browser and version you're running.
Original comment by Jeff.Mott.OR
on 23 Jun 2013 at 4:19
Google Code Exporter commented
Closing unless or until a simple and straightforward failing case is provided.
Original comment by Jeff.Mott.OR
on 25 Jun 2013 at 5:32
- Changed state: Invalid