basic diaspora decryption
This commit is contained in:
parent
dbc3283681
commit
a61ec584d6
2 changed files with 117 additions and 30 deletions
17
boot.php
17
boot.php
|
@ -2969,4 +2969,19 @@ function generate_guid() {
|
|||
$found = false;
|
||||
} while ($found == true );
|
||||
return $guid;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
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);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue