I’m using the SJCL library to encrypt/decrypt messages. The question I have is that I don’t know which is used AES or SHA256
Here is my code:
var h = sjcl.codec.hex, count = 2048 ;
salt = h.fromBits(sjcl.random.randomWords('10','0'));
var key = h.fromBits( sjcl.misc.pbkdf2(somePassword, h.toBits(salt), count) ) ;
Next I can encrypt/decrypt like
var encMessage = sjcl.encrypt(key, message) ;
sjcl.decrypt(key, encMessage) ;
AES or SHA256 or something else ?
pbkdf2for key generation is usingHMACwithSHA256. But the default encryption key size with sjcl forAES-CCMis only128bits. If you wantAES-CCM-256, I think you need to do the following, you also don’t have to callpbkdf2directly.