Lines Matching refs:password
158 * Use AES to encrypt 'plaintext' with 'password' using 'nBits' key, in 'Counter' mode of operation
164 function AESEncryptCtr(plaintext, password, nBits) {
167 // for this example script, generate the key by applying Cipher to 1st 16/24/32 chars of password;
168 // for real-world applications, a more secure approach would be to hash the password e.g. with SHA-1
171 for (var i=0; i<nBytes; i++) pwBytes[i] = password.charCodeAt(i) & 0xff;
224 * Use AES to decrypt 'ciphertext' with 'password' using 'nBits' key, in Counter mode of operation
230 function AESDecryptCtr(ciphertext, password, nBits) {
235 for (var i=0; i<nBytes; i++) pwBytes[i] = password.charCodeAt(i) & 0xff;
419 var password = "O Romeo, Romeo! wherefore art thou Romeo?";
421 var cipherText = AESEncryptCtr(plainText, password, 256);
422 var decryptedText = AESDecryptCtr(cipherText, password, 256);