diff --git a/Encryptors/Rijndael128Encryptor.php b/Encryptors/Rijndael128Encryptor.php index 34b3b7fd..5003f098 100644 --- a/Encryptors/Rijndael128Encryptor.php +++ b/Encryptors/Rijndael128Encryptor.php @@ -36,14 +36,13 @@ public function __construct($key) { public function encrypt($data) { if(is_string($data)) { - $test = mcrypt_encrypt( + return trim(base64_encode(mcrypt_encrypt( MCRYPT_RIJNDAEL_128, $this->secretKey, $data, MCRYPT_MODE_ECB, $this->initializationVector - ); - return trim(base64_encode($test)). ""; + ))). ""; } return $data; diff --git a/Encryptors/Rijndael256Encryptor.php b/Encryptors/Rijndael256Encryptor.php index cb2d191d..20d1011c 100644 --- a/Encryptors/Rijndael256Encryptor.php +++ b/Encryptors/Rijndael256Encryptor.php @@ -55,6 +55,9 @@ public function encrypt($data) { public function decrypt($data) { if(is_string($data)) { + + $data = str_replace("", "", $data); + return trim(mcrypt_decrypt( MCRYPT_RIJNDAEL_256, $this->secretKey,