#!/usr/bin/perl use strict; use List::Util 'shuffle'; $_="Just Another Perl Hacker,"; my @plaintext = map { ord } split ""; my @ciphertext = (); my @init = ('$}=(1<<5)+0xa','$}=42'); my @op = ( '$}++', '$}--', '--$}', '++$}', '$}+=0xa', '$}-=0x14', '$}+=0x13' ); for (my $i=0; $i<@plaintext; $i++) { my (@stack,$result,$stop); push @stack, $init[int(rand(@init))]; while (!$stop) { my $heap = pop @stack; $result = eval "$heap"; if ($result == $plaintext[$i]) { push @ciphertext, $heap; $stop++; next; } else { next if ( abs($result) > 127 ); @op = shuffle(@op); for (my $j; $j<@op; $j++) { push @stack, "$heap;$op[$j]"; } } } } print "#!/usr/bin/perl\nprint chr foreach ("; for (my $i=0; $i<@ciphertext; $i++) { print "do{$ciphertext[$i]}",((($i+1)==@ciphertext)? ")":","); } print "\n#Just Another Perl Hacker";