Skip to content

Instantly share code, notes, and snippets.

@Los-had
Created June 21, 2021 10:44
Show Gist options
  • Save Los-had/6dd6c65706cb575412260c3061230423 to your computer and use it in GitHub Desktop.
Save Los-had/6dd6c65706cb575412260c3061230423 to your computer and use it in GitHub Desktop.
Quebrando a cifra de César com php
function cesar_crack_ascii($ut) {
$txt = $ut;
$ftxt = '';
$v = str_split($txt);
$len = strlen($txt);
for ($nc = 0; $nc <= 26; $nc++) {
for ($g = 0; $g <= $len; $g++) {
$c = ord(@$v[$g]) - $nc;
$ftxt = $ftxt.chr($c);
}
echo $ftxt . "<br>";
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment