Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

perl obfuscation

by Anonymous Monk
on May 12, 2000 at 22:54 UTC ( [id://11343]=perlquestion: print w/replies, xml ) Need Help??

Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

i am really amazed with perl obfuscation.... and i realy want to give it a try, is there any guide on the net with regards to perl obfuscation? thanks in advance.

Replies are listed 'Best First'.
Re: perl obfuscation
by snowcrash (Friar) on May 12, 2000 at 23:37 UTC
    hmm... you could take a look at the obfuscated area, read the comments to get an idea what is considered "good" ofuscation.
    have a look at the winners of the annual perl journal's obfuscation contest. go to tpj.com and search for obfuscated.
    but then, the best obfuscation (imho) is to do something no one has done before you. just copy/pasting from other obfuscated code aint fun.
    general guidelines? hm... what comes to my mind is:
    • use functions and variables that are seldomly used
    • use strange side effects
    • remove white space
    • don't use variable names that make any sense
    • mislead the reader of your code (make it looking like something it isn't)
    • have fun!

    just my 2 cents
    sc
    :wq
      You forgot obfuscated logic!

      I usually print backspace characters in loops just to keep it tricky. I think obfuscated code shouldn't only be hard to read, but it should be hard to follow as well!

      And that's my R$ 0.02 (Brazilian cents)...
      so perl obfuscation is something like not following the standard pattern of programming.... and probably it's purpose is to mislead the reader of the code w/c also happend to me. well thanks, i guess there is no such thing as guidelines on how to write obfuscated codes in perl.
Re: perl obfuscation
by Anonymous Monk on May 12, 2000 at 23:19 UTC
    While I can't answer for sure as to guides, I can tell you that if you are beginning programming, obfuscation is not something you want to get into. First learn to write clear, concise, functioning, commented code; then later if you're still interested, reverse all of those things, and you'll have obfuscated code.
      Well, reverse all of them except the "functioning" part :) You do still need that.
Re: perl obfuscation
by Dominus (Parson) on Nov 27, 2000 at 00:01 UTC
Re: perl obfuscation
by kryten (Scribe) on May 15, 2000 at 20:59 UTC
    Try to avoid using pack and ord too obviously. There are a too many 'obfuscated' examples out there using that method already.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others having an uproarious good time at the Monastery: (5)
As of 2024-04-24 00:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found