aboutsummaryrefslogtreecommitdiffstats
path: root/boot.php
diff options
context:
space:
mode:
authorFriendika <info@friendika.com>2011-07-30 00:31:00 -0700
committerFriendika <info@friendika.com>2011-07-30 00:31:00 -0700
commita61ec584d60013f7845d0999deb550a2149f4e76 (patch)
tree85765fcc868a2afa112fe4ed1048587d3b18cf13 /boot.php
parentdbc328368187bca4c0365ab56db57437dfda9f38 (diff)
downloadvolse-hubzilla-a61ec584d60013f7845d0999deb550a2149f4e76.tar.gz
volse-hubzilla-a61ec584d60013f7845d0999deb550a2149f4e76.tar.bz2
volse-hubzilla-a61ec584d60013f7845d0999deb550a2149f4e76.zip
basic diaspora decryption
Diffstat (limited to 'boot.php')
-rw-r--r--boot.php17
1 files changed, 16 insertions, 1 deletions
diff --git a/boot.php b/boot.php
index 68cda3bf2..5d4f54769 100644
--- a/boot.php
+++ b/boot.php
@@ -2969,4 +2969,19 @@ function generate_guid() {
$found = false;
} while ($found == true );
return $guid;
-} \ No newline at end of file
+}
+
+
+function pkcs5_pad ($text, $blocksize)
+{
+ $pad = $blocksize - (strlen($text) % $blocksize);
+ return $text . str_repeat(chr($pad), $pad);
+}
+
+function pkcs5_unpad($text)
+{
+ $pad = ord($text{strlen($text)-1});
+ if ($pad > strlen($text)) return false;
+ if (strspn($text, chr($pad), strlen($text) - $pad) != $pad) return false;
+ return substr($text, 0, -1 * $pad);
+}