From e793fc9973a763b14f1f6cddb425cd5c41aa799c Mon Sep 17 00:00:00 2001 From: zotlabs Date: Thu, 1 Dec 2016 18:12:18 -0800 Subject: trim iv in STD_encapsulate --- include/crypto.php | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include/crypto.php') diff --git a/include/crypto.php b/include/crypto.php index 4b78bb63d..df4347f22 100644 --- a/include/crypto.php +++ b/include/crypto.php @@ -67,11 +67,13 @@ function AES128CBC_decrypt($data,$key,$iv) { function STD_encrypt($data,$key,$iv) { $key = substr($key,0,32); + $iv = substr($iv,0,16); return openssl_encrypt($data,'aes-256-cbc',str_pad($key,32,"\0"),OPENSSL_RAW_DATA,str_pad($iv,16,"\0")); } function STD_decrypt($data,$key,$iv) { $key = substr($key,0,32); + $iv = substr($iv,0,16); return openssl_decrypt($data,'aes-256-cbc',str_pad($key,32,"\0"),OPENSSL_RAW_DATA,str_pad($iv,16,"\0")); } -- cgit v1.2.3