cryptojs: How to generate AES passphrase
问题 I want to generate a 256bit password for my AES encryption. When I check the password after the encryption it is different from my initial password. What am I doing wrong? Or is there some security mechanism I am not aware of? My code: password=Generate_key(); var encrypted = CryptoJS.AES.encrypt("Message", password); //Those two should be the same document.write(password+"<br>"); document.write(encrypted.key); function Generate_key() { var key = ""; var hex = "0123456789abcdef"; for (i = 0;