diff options
author | Friendika <info@friendika.com> | 2011-07-30 00:31:00 -0700 |
---|---|---|
committer | Friendika <info@friendika.com> | 2011-07-30 00:31:00 -0700 |
commit | a61ec584d60013f7845d0999deb550a2149f4e76 (patch) | |
tree | 85765fcc868a2afa112fe4ed1048587d3b18cf13 /boot.php | |
parent | dbc328368187bca4c0365ab56db57437dfda9f38 (diff) | |
download | volse-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.php | 17 |
1 files changed, 16 insertions, 1 deletions
@@ -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); +} |