Last active
March 17, 2016 15:53
-
-
Save endreszabo/553cf2a10c1f133c7980 to your computer and use it in GitHub Desktop.
Perl that XORs.. for science!
This file contains 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
#!/usr/bin/env perl | |
use strict; | |
use warnings; | |
use utf8; | |
use List::Util qw( shuffle ); | |
my $o='`^._-=>;:/()|[]{}#@%+$&?*~,"'; | |
my $s=join(" ",@ARGV)||"egyenisegek vagytok mind!"; | |
sub xorsplit($){my$oa;my$ob;out:foreach my$c(split//,shift){foreach my$a(shuffle split//,$o){foreach my$b(shuffle split//,$o){if((ord($a)^(ord($b)))==ord($c)){$oa.=$a; $ob.=$b;next out;}}}printf"Failed looking up '%s'\n",$c;}return($oa,$ob);} | |
printf"use re 'eval';''=~('(?{'.('%s'^'%s').',\$\/})')\n",xorsplit("print \"$s\""); | |
printf"yes|perl -pe'\$_=q\"%s\"|q\"%s\"",xorsplit($s); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment