Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

1337JAPH

by Anonymous Monk
on Aug 31, 2004 at 21:40 UTC ( [id://387332]=obfuscated: print w/replies, xml ) Need Help??

#!/usr/bin/perl @l=split / /, "a01001010 b01111100 c01011111 b01111100 d00110101 e0111 +0100 q0 f00110100 b01111100 g01011100 b01111100 h00110000 e01110100 b +01111100 i00101101 b01111100 j00110011 k01010010 q0 l01010000 j001100 +11 m01110010 b01111100 q0 n01001000 f00110100 o00111110 p00111100 h00 +110000 k01010010";@n=split //, "abcbdeqfbgbhebibjkqljmbqnfophk";my %g +;for(@l){($e,$r)=($_=~m/^(\w)(\d+)$/);$g{"$e"}=$r;}for(@n){print(pack +("B8",$g{$_}))if($g{$_})||print " ";}print "\n";



Well, here's my first shot at obfuscation...

I'm having trouble finding good resources on some of the more common techniques...I've heard people say, 'this one's my take on <common theme>...' Any ideas where I can get some ideas? I realize that I can read you other monks' nodes here, but barely any are explained in detail. I'd explain this one, but it's not hard at all.

Comments/suggestions/critiques would be appreciated.

Replies are listed 'Best First'.
Re: 1337JAPH
by cchampion (Curate) on Aug 31, 2004 at 22:05 UTC
      Awesome, thanks a lot. I wonder how I didn't get any of that stuff Googling...the articles those nodes link to, anyway.

        Google doesn't index dynamic sites like the Monastery (not very well, anyway). That's why http://perlmonks.thepen.com exists, although sometimes that doesn't help either. Your best bet to find stuff around here is Super Search.

Re: 1337JAPH
by xCodexWarriorx (Acolyte) on Aug 31, 2004 at 21:46 UTC
    Wow. I thought I was logged in. This is mine :-[

      Like you, I'm only just starting out in the world of obfuscation... This is just a few thoughts that came into my head when I read your code. Not necessarily criticisms!

      Try to avoid assigning to "real" variables like @n etc. Use perl builtin variables like $= or $; or just put the values inline. I changed your assignment of @l to a quoted string using qw;; (there are lots of options for the delimiters of quoted strings, ; is one I've been playing about with recently) - more obfu than an "English" word like split.

      You also had some dupes in @l which I removed. I'm not sure if they were in there on purpose (to confuse/mislead) or not. Same goes for q0, which I removed. Again this doesn't necessary make it more (or less) obfuscated but it does compact things a bit. You could also consider muddling up the list in non-alphabetic order.

      I re-arranged a few other things, using $1,$2 instead of $e,$r and re-ordered the print/pack code into something a little shorter, without changing the basic meaning of the code.

      for(qw; a01001010 b01111100 c01011111 d00110101 e01110100 f00110100 g01011100 h00110000 i00101101 j00110011 k01010010 l01010000 m01110010 n01001000 o00111110 p00111100;){/(\w)(\d+)/;$g{$1}=$2} for(split//,q;abcbdeqfbgbhebibjkqljmbqnfophk;){print $g{$_}?pack"B8",$g{$_}:' '}

      I hope this is useful, if only a little. Others more experienced (or with more warped minds, depending on how you look at it) may suggest more interesting ways to obfuscate your code. Perhaps you could consider changing from binary to some other more wacky pack format (maybe uuencode?). Good luck anyway.


      s^^unp(;75N=&9I<V@`ack(u,^;s|\(.+\`|"$`$'\"$&\"\)"|ee;/m.+h/&&print$&

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: obfuscated [id://387332]
Approved by cchampion
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chanting in the Monastery: (4)
As of 2024-04-19 04:06 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found