Skip to content

Instantly share code, notes, and snippets.

@xorcat
Last active October 14, 2019 08:36
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save xorcat/b025466ffb16826f5a8c8916d60aba39 to your computer and use it in GitHub Desktop.
Save xorcat/b025466ffb16826f5a8c8916d60aba39 to your computer and use it in GitHub Desktop.
#!/usr/bin/perl
# credit not to me, but I've lost the original source :(
@xlat = ( 0x64, 0x73, 0x66, 0x64, 0x3b, 0x6b, 0x66, 0x6f, 0x41,
0x2c, 0x2e, 0x69, 0x79, 0x65, 0x77, 0x72, 0x6b, 0x6c,
0x64, 0x4a, 0x4b, 0x44, 0x48, 0x53 , 0x55, 0x42 );
chomp ($epass = $ARGV[0]);
if (!(length($epass) & 1)) {
$ep = $epass;
$dpass = "";
($s, $e) = ($ep =~ /^(..)(.+)/);
for ($i = 0; $i < length($e); $i+=2){
$dpass .= sprintf "%c",hex(substr($e,$i,2))^$xlat[$s++];
}
}
print "$dpass\n";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment