javascriptcryptographyencryption-symmetricsjcl

How to generate a symmetric key using sjcl


Is it possible to generate symmetric keys using sjcl? I want to return the symmetric key rather than just calling the sjcl.encrypt() function. Please provide a code example if possible.


Solution

  • Here's how it is done. const key = sjcl.random.randomWords(8)(for a 256-bit key) I got the answer from Nil Kenneweg, on a different forum.