Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"

Code Obfuscator

by redlemon (Hermit)
on Jan 24, 2005 at 20:18 UTC ( #424690=CUFP: print w/replies, xml ) Need Help??

Recently I've seen a number of Seekers who ask for ways of obfuscating production code. And although anybody will tell you it's a bad idea, I'd like to provide where there is a real demand. Service is my middle name.

Without further ado, I present you: the code obfuscator. It uses psychology, fear, doubt and uncertainty and the newest advances of modern science to deter all but the most daring and curious hackers.

#!/usr/bin/perl # --- highly optimized obfuscation coder ------------------------- +--------- # sub encode(@) { local $_ = q/ M(PHC($YO=&AI;F<@:7,@87,@:70@<V5E;7,N+BXN+@HC"B,@4&QE87-E(&)E M(&%W87)E('1H870@=&AE(&9O;&QO=VEN9R!C;V1E(&ES(&AI9VAL>2!O8F9U M<V-A=&5D('1O"B,@:&ED92!T:&4@9&5T86EL<R!O9B!I=',@:6UP;&5M96YT M871I;VX@9G)O;2!T:&4@<75E<W1I;F<@97EE+@HC"B,@4F5A9&EN9R!I="!M M87D@:6YD=6-E(&-O;F9U<VEO;BP@=&5M<&]R87)Y(&)L:6YD;F5S<R!A;F0@ M<&%R=&EA;`HC(&EN<V%N:71Y+B!";&%C:R!H;VQE<R!H879E(&)E96X@:VYO M=VX@=&\@;W!E;B!U<"!A;F0@<W=A;&QO=R!T:&4*(R!R96%D97(N($%N9"!E M=F5N('1H;W5G:"P@86-C;W)D:6YG('1O(&UO9&5R;B!S8VEE;F-E+"!I;B!S M=6-H(&$*(R!C87-E(&YO="!A;&P@:6YF;W)M871I;VX@:7,@;&]S="P@:70@ M=VEL;"!B92!C:&%N9V5D(&)E>6]N9"!D96-R>7!T:6]N+@HC"B,@4V\@8F4@ H=V%R;F5D.B`*(R!.;W1H:6YG(&ES(&%S(&ET('-E96US+BXN+@HC"@``/; s/^\s+//gm;splice@_,$_[0]=~/^#\s*!/?1:0,0,unpack'u',$_; join'',@_; } # --- process all files ------------------------------------------ +--------- # foreach (@ARGV) { if (open my $fp, $_) { print encode<$fp> } else { warn "can't open $_:$!\n" } } __END__ =head1 NAME obfucoder -- Obfuscate files for all but the most daring readers =head1 SYNOPSIS obfucode filename ... =head1 DESCRIPTION This coder reads the files that are pased to it on the command line and encode them using an obfuscation method based on modern advances in science and psychology, so that only the most hardened, daring and curious hacker will attempt to read more than the first couple of lines. =head1 AUTHOR Red "Service" Lemon

Grain-of-Salt department

Replies are listed 'Best First'.
Re: Code Obfuscator
by Jaap (Curate) on Jan 25, 2005 at 15:56 UTC
    April fools or something? besides adding a comment, it doesn't do much.

      It doesn't even save the changes to the file...
      Not that I'd want it to...

      Linux, sci-fi, and Nat Torkington, all at Penguicon 3.0
      perl -e 'print(map(chr,(0x4a,0x41,0x50,0x48,0xa)))'

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: CUFP [id://424690]
Approved by Tanktalus
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (6)
As of 2017-03-30 12:02 GMT
Find Nodes?
    Voting Booth?
    Should Pluto Get Its Planethood Back?

    Results (356 votes). Check out past polls.