pbkdf2

223 views
Skip to first unread message

Michaela Merz

unread,
Mar 6, 2013, 4:51:57 PM3/6/13
to sjcl-d...@googlegroups.com

Hey there:

While trying to get sjcl compatible with JAVA/PHP, I ran into trouble with pbkdf2. I wasn't even able to verify SJCL's pbkdf2 against the reference of RFC6070. I am sure, I am to blame, but

var s = sjcl.codec.utf8String.toBits("salt");
var a =sjcl.misc.pbkdf2("password",s,1,160);
var raw = sjcl.codec.String.fromBits(a);
console.log(bin2hex(raw))

resulted in 120fb6cffcf8b32c43e7225256c4f837a86548c9 and not the expected result:

Input:
       P = "password" (8 octets)
       S = "salt" (4 octets)
       c = 1
       dkLen = 20

     Output:
       DK = 0c 60 c8 0f 96 1f 0e 71
            f3 a9 b5 24 af 60 12 06
            2f e0 37 a6             (20 octets)


Any pointers are greatly appreciated.

Michaela

Mike Hamburg

unread,
Mar 6, 2013, 9:30:38 PM3/6/13
to sjcl-d...@googlegroups.com
SJCL's PBKDF2 code uses HMAC-SHA256 by default, not HMAC-SHA1.

Sent from my phone.  Please excuse brevity and typos.
--
You received this message because you are subscribed to the Google Groups "SJCL discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sjcl-discuss...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 
Reply all
Reply to author
Forward
0 new messages