-
-
Save geekwolverine/4830a7112423daf00474851b82c427d9 to your computer and use it in GitHub Desktop.
Youtube - Decrypt cipher signature
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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