aboutsummaryrefslogtreecommitdiffstats
path: root/include/crypto.php
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2015-01-11 15:13:45 -0800
committerfriendica <info@friendica.com>2015-01-11 15:13:45 -0800
commit381f8a1b4275823712b3cb9f27c17d9b624d1e8e (patch)
tree1abcecaa001220e292da5ff953447fb872324fb2 /include/crypto.php
parent6f7b1960af1fe8480a7072b689f86b194cd88643 (diff)
downloadvolse-hubzilla-381f8a1b4275823712b3cb9f27c17d9b624d1e8e.tar.gz
volse-hubzilla-381f8a1b4275823712b3cb9f27c17d9b624d1e8e.tar.bz2
volse-hubzilla-381f8a1b4275823712b3cb9f27c17d9b624d1e8e.zip
optionally use openssl encryption functions (higher performance over mcrypt, but potentially more likely to have been compromised)
Diffstat (limited to 'include/crypto.php')
-rw-r--r--include/crypto.php4
1 files changed, 2 insertions, 2 deletions
diff --git a/include/crypto.php b/include/crypto.php
index 41143f04e..ab083cfaa 100644
--- a/include/crypto.php
+++ b/include/crypto.php
@@ -40,7 +40,7 @@ function pkcs5_unpad($text)
function AES256CBC_encrypt($data,$key,$iv) {
if(get_config('system','openssl_encrypt')) {
- return openssl_encrypt(pkcs5_pad($data,16),'aes-256-cbc',str_pad($key,32,"\0"),OPENSSL_RAW_DATA,str_pad($iv,16,"\0"));
+ return openssl_encrypt($data,'aes-256-cbc',str_pad($key,32,"\0"),OPENSSL_RAW_DATA,str_pad($iv,16,"\0"));
}
return mcrypt_encrypt(
MCRYPT_RIJNDAEL_128,
@@ -52,7 +52,7 @@ function AES256CBC_encrypt($data,$key,$iv) {
function AES256CBC_decrypt($data,$key,$iv) {
if(get_config('system','openssl_encrypt')) {
- return openssl_decrypt(pkcs5_unpad($data,16),'aes-256-cbc',str_pad($key,32,"\0"),OPENSSL_RAW_DATA,str_pad($iv,16,"\0"));
+ return openssl_decrypt($data,'aes-256-cbc',str_pad($key,32,"\0"),OPENSSL_RAW_DATA,str_pad($iv,16,"\0"));
}
return pkcs5_unpad(mcrypt_decrypt(
MCRYPT_RIJNDAEL_128,