3 ms·
> Nothing says secure like PBKDF2-SHA1 with 50 rounds. This code is deriving an encryption key and an HMAC key from a master key. The master key is already a r
by orthecreedence 11y ago
> Nothing says secure like PBKDF2-SHA1 with 50 rounds.
This code is deriving an encryption key and an HMAC key from a master key. The master key is already a random value, so even if you managed to "crack" either one of the derived keys, you wouldn't know it.
> or timing attacks on MAC validation
Good point, I'll fix that!
- sarciszewski 11y agoThe correct tool for the key-splitting job is HKDF. If SJCL doesn't offer HKDF, I'll be surprised. It's not hard to implement, however.
- orthecreedence 11y agoThanks. I researched key splitting when I was building the CBC+HMAC version of the crypto, but HKDF never came up. This is why there are experts (which I do not claim to be). Your feedback on the crypto side of things is really important and well received. I appreciate you taking the time to look through the code.
- sarciszewski 11y ago> This is why there are experts (which I do not claim to be). Heh, humility goes a long way towards becoming an expert. ;) Thanks for taking this feedback well. :) Also, a friend in IRC point out that: https://github.com/turtl/js/blob/master/library/tcrypt.js#L677-L679 https://github.com/turtl/js/blob/master/library/tcrypt.js#L6... Your default iterations here is only 400.