From 973fcd36249ac1670e2df2e44e71088830bea4c2 Mon Sep 17 00:00:00 2001 From: Michael Date: Thu, 30 Mar 2017 23:21:52 +0000 Subject: [PATCH] Test with OpenSSL --- include/diaspora.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/diaspora.php b/include/diaspora.php index 3250fb3da5..29278349f1 100644 --- a/include/diaspora.php +++ b/include/diaspora.php @@ -171,6 +171,8 @@ class Diaspora { * @return string encrypted data */ private static function aes_encrypt($key, $iv, $data) { + return openssl_encrypt($data, 'aes-256-cbc', str_pad($key, 32, "\0"), OPENSSL_RAW_DATA, str_pad($iv, 16, "\0")); + $aes = new Crypt_AES(); $block_length = 128; @@ -199,6 +201,8 @@ class Diaspora { * @return string decrypted data */ private static function aes_decrypt($key, $iv, $encrypted) { + return openssl_decrypt($encrypted,'aes-256-cbc', str_pad($key, 32, "\0"), OPENSSL_RAW_DATA,str_pad($iv, 16, "\0")); + $aes = new Crypt_AES(); $block_length = 128; -- 2.39.5