Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save geekwolverine/4830a7112423daf00474851b82c427d9 to your computer and use it in GitHub Desktop.
Save geekwolverine/4830a7112423daf00474851b82c427d9 to your computer and use it in GitHub Desktop.
Youtube - Decrypt cipher signature
<?php
// 2017-02-28
function decrypt_signature($s){
$nF = function(&$a, $b){
$c = $a[0];
$a[0] = $a[$b % count($a)];
$a[$b] = $c;
};
$fj = function(&$a, $b){
array_splice($a, 0, $b);
};
$c0 = function(&$a){
$a = array_reverse($a);
};
$a = str_split($s);
$c0($a, 46);
$fj($a, 3);
$nF($a, 53);
$fj($a, 1);
$c0($a, 42);
$nF($a, 25);
$c0($a, 58);
return join('', $a);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment