Skip to content

Instantly share code, notes, and snippets.

@edhelas
Last active November 15, 2019 13:40
Show Gist options
  • Save edhelas/b35ed91cd1efbea0b9cd20e16fd19bee to your computer and use it in GitHub Desktop.
Save edhelas/b35ed91cd1efbea0b9cd20e16fd19bee to your computer and use it in GitHub Desktop.
Message décodé
<?php
$a = 'd46efb6a041c4e21546f3af22e462ff17fe68fe937362b3e3044214d145a1a065d0b56185c0969b7b5ac74d2a0c5a080f37cea8aed74fe67b99ad599ce52e85cae';
$a = unpack('C*', hex2bin($a));
$decoded = [];
$reversed = $a;
$size = count($reversed);
foreach ($reversed as $key => $value) {
if ($key < $size) {
array_push($decoded, ($value + $reversed[$key +1]) % 256);
}
}
var_dump(utf8_encode(pack('C*', ...$decoded)));
// "Bien joué, tu peux maintenant chanter la Free software Song :D ®"
// Join us now and share the software! :D
// Il y a un petit soucis avec l'accent, je crois que c'est parceque é est sur deux octets et pas un
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment