PasswordMaker Forums
February 09, 2010, 12:28:07 PM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Bug in HMAC-SHA-256  (Read 1719 times)
asgeirn
Guest
« on: November 26, 2005, 09:48:00 AM »

I've discovered a small copy/paste bug in the rstr_hmac_sha256 function in sha256.js from the passwordmaker.zip downloadable version.

At the end of the function, where the opad is mixed with the ipad hash, the code reads:
Code:
return PasswordMaker_HashUtils.binb2rstr(this.binb_sha256(opad.concat(hash), 512 + 160));

However, since SHA-256 is 256 bits, the line should read:
Code:
return PasswordMaker_HashUtils.binb2rstr(this.binb_sha256(opad.concat(hash), 512 + 256));

I've confirmed this by comparing Paul Johnston's HMAC-MD5 and HMAC-SHA-1 versions.

-- Asgeir
Logged
Eric H. Jung
grimholtz
Administrator
*****
Offline Offline

Posts: 3262


WWW
« Reply #1 on: November 26, 2005, 01:46:43 PM »

Hi asgeirn,

Thanks for reporting this. Pedro Gimeno also reported this in IRC chat about a week ago. However, it exists in all PasswordMaker editions -- not just the passwordmaker.zip downloadable version. So although it's a bug, the consistency of the bug means password generation is also consistent across all editions.

Very shortly, PasswordMaker versions will be released which fix the bug and give users the option of selecting the old SHA-256 (buggy) algorithm or the new one. This was also done with MD-5, so you'll see "MD-5" and "MD-5 Version 0.6" in the algorithm list. Eventually, the buggy algorithms will be removed altogether.

Thanks again,
Eric
Logged
PasswordMaker Forums
   

 Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC Valid XHTML 1.0! Valid CSS!