Lines Matching refs:mode
933 // rijndaelEncrypt(plaintext, key, mode)
934 // Encrypts the plaintext using the given key and in the given mode.
938 // to an array of bytes. The third parameter "mode" is a string indicating
939 // the encryption mode to use, either "ECB" or "CBC". If the parameter is
945 function rijndaelEncrypt(plaintext, key, mode) {
952 if (mode == "CBC") {
956 mode = "ECB";
967 if (mode == "CBC") {
978 // rijndaelDecrypt(ciphertext, key, mode)
979 // Decrypts the using the given key and mode. The parameter "ciphertext"
983 // parameter "mode" is a string, either "CBC" or "ECB".
989 function rijndaelDecrypt(ciphertext, key, mode) {
998 if (!mode) { mode = "ECB"; } // assume ECB if mode omitted
1002 // work backwards to accomodate CBC mode
1006 if (mode == "CBC") {
1016 if (mode == "ECB") {