aboutsummaryrefslogtreecommitdiffstats
path: root/boot.php
diff options
context:
space:
mode:
authorFriendika <info@friendika.com>2010-11-30 18:32:34 -0800
committerFriendika <info@friendika.com>2010-11-30 18:32:34 -0800
commit99bbc29747e8b8f4f9a7a1952aecbbd202ed2470 (patch)
tree683417787780551f78b888fc37366d4ea239b4ba /boot.php
parent67e827e128a4c446b89f581793f64fd0f1299389 (diff)
downloadvolse-hubzilla-99bbc29747e8b8f4f9a7a1952aecbbd202ed2470.tar.gz
volse-hubzilla-99bbc29747e8b8f4f9a7a1952aecbbd202ed2470.tar.bz2
volse-hubzilla-99bbc29747e8b8f4f9a7a1952aecbbd202ed2470.zip
rino landing
Diffstat (limited to 'boot.php')
-rw-r--r--boot.php24
1 files changed, 24 insertions, 0 deletions
diff --git a/boot.php b/boot.php
index a818f5a86..d1e570d3b 100644
--- a/boot.php
+++ b/boot.php
@@ -1544,3 +1544,27 @@ function gravatar_img($email) {
return $url;
}}
+if(! function_exists('aes_decrypt')) {
+function aes_decrypt($val,$ky)
+{
+ $key="\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0";
+ for($a=0;$a<strlen($ky);$a++)
+ $key[$a%16]=chr(ord($key[$a%16]) ^ ord($ky[$a]));
+ $mode = MCRYPT_MODE_ECB;
+ $enc = MCRYPT_RIJNDAEL_128;
+ $dec = @mcrypt_decrypt($enc, $key, $val, $mode, @mcrypt_create_iv( @mcrypt_get_iv_size($enc, $mode), MCRYPT_DEV_URANDOM ) );
+ return rtrim($dec,(( ord(substr($dec,strlen($dec)-1,1))>=0 and ord(substr($dec, strlen($dec)-1,1))<=16)? chr(ord( substr($dec,strlen($dec)-1,1))):null));
+}}
+
+
+if(! function_exists('aes_encrypt')) {
+function aes_encrypt($val,$ky)
+{
+ $key="\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0";
+ for($a=0;$a<strlen($ky);$a++)
+ $key[$a%16]=chr(ord($key[$a%16]) ^ ord($ky[$a]));
+ $mode=MCRYPT_MODE_ECB;
+ $enc=MCRYPT_RIJNDAEL_128;
+ $val=str_pad($val, (16*(floor(strlen($val) / 16)+(strlen($val) % 16==0?2:1))), chr(16-(strlen($val) % 16)));
+ return mcrypt_encrypt($enc, $key, $val, $mode, mcrypt_create_iv( mcrypt_get_iv_size($enc, $mode), MCRYPT_DEV_URANDOM));
+}} \ No newline at end of file