someone can tell me how rijndael works?
for now i need to handle key
and iv
generated from C#
(using rijndael + rfc2898derivebytes) to match with CryptoJS
code snippet of C#:
byte[] saltArray = Encoding.ASCII.GetBytes("20190925");
Rfc2898DeriveBytes pdb = new Rfc2898DeriveBytes("password", saltArray, 1000);
rijndael.Key = pdb.GetBytes(32);
//output c1b34ea814586db4a22dad37e11c7256322ab0eee3a14ed1898f93d7a264242f
rijndael.IV = pdb.GetBytes(16);
//output 063ead20a9d5f35ab83e1156ebe7c099
the result of rijndael.Key
and rijndael.IV
is different. I thought rijndael.IV
will show half of rijndael.Key
value because of pdb.GetBytes(16)
is half of pdb.GetBytes(32)
i can match the key of rijndael+rfc2898derivebytes
using CryptoJS using below code:
let key = CryptoJS.PBKDF2('password', '20190925', {keySize:256/32, iterations:1000})
//output c1b34ea814586db4a22dad37e11c7256322ab0eee3a14ed1898f93d7a264242f
but i don't know how to get the same IV with cryptoJS. anyone has an idea?