From ccf7464d6f66f38549c63fb4862ae81e029e06ff Mon Sep 17 00:00:00 2001 From: Marcin Kurczewski Date: Sat, 12 Apr 2014 17:04:32 +0200 Subject: [PATCH] Changed ECB to CBC --- src/Helpers/TextHelper.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Helpers/TextHelper.php b/src/Helpers/TextHelper.php index f798ea0e..1ec48994 100644 --- a/src/Helpers/TextHelper.php +++ b/src/Helpers/TextHelper.php @@ -180,7 +180,7 @@ class TextHelper { $salt = \Chibi\Registry::getConfig()->main->salt; $alg = MCRYPT_RIJNDAEL_256; - $mode = MCRYPT_MODE_ECB; + $mode = MCRYPT_MODE_CBC; $iv = mcrypt_create_iv(mcrypt_get_iv_size($alg, $mode), MCRYPT_RAND); return trim(base64_encode(mcrypt_encrypt($alg, $salt, $text, $mode, $iv))); } @@ -189,7 +189,7 @@ class TextHelper { $salt = \Chibi\Registry::getConfig()->main->salt; $alg = MCRYPT_RIJNDAEL_256; - $mode = MCRYPT_MODE_ECB; + $mode = MCRYPT_MODE_CBC; $iv = mcrypt_create_iv(mcrypt_get_iv_size($alg, $mode), MCRYPT_RAND); return trim(mcrypt_decrypt($alg, $salt, base64_decode($text), $mode, $iv)); }