From af0b10c4a07dd7f4ffdb441cd31236412877521e Mon Sep 17 00:00:00 2001 From: Bram van der Veen <96aa48@gmail.com> Date: Sun, 16 Aug 2015 18:56:54 +0200 Subject: [PATCH] Did a hotfix on crypt.js --- crypt.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/crypt.js b/crypt.js index 7bb88f9..c839905 100644 --- a/crypt.js +++ b/crypt.js @@ -14,16 +14,13 @@ var cryptEncoding = 'hex'; var algo = 'aes192'; var passwd = 'JMU6DAQpzt32hJ2WndJxFvk3WHWqFcscq9yMMYkr8kgTtsam'; -//Prepare the ciphering and deciphering. -var cipher = crypto.createCipher(algo, passwd); -var decipher = crypto.createDecipher(algo, passwd); - /** * Function for encrypting a string. * @param {String} str - String that you want to encrypt. * @return {String} encryptArray - Encrypted string. */ function encrypt(str) { + var cipher = crypto.createCipher(algo, passwd); var encryptArray = []; encryptArray.push(cipher.update(str, encoding, cryptEncoding)); @@ -38,6 +35,7 @@ function encrypt(str) { * @return {String} The decrypted string. */ function decrypt(str) { + var decipher = crypto.createDecipher(algo, passwd); var decryptArray = []; try {