Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

(Ovid) RE: Automatic Perl Obfuscation

by Ovid (Cardinal)
on Oct 24, 2000 at 19:57 UTC ( [id://38135]=note: print w/replies, xml ) Need Help??


in reply to Automatic Perl Obfuscation

I assume you're not wanting this to enter any obfuscation contests. I would be astonished if an automatic obfuscator could win -- oh, wait, they call that C, right? :)

If you just want this for playing around, BBQ has the right idea. It's much more fun (and instructive) to do this yourself. However, if you're one of those "security by obscurity" types (I certainly hope not!), you could try a simple method that I've seen routinely applied to JavaScript: convert all variables and sub names to random strings.

To be fair, it might be an impossible job to automate for any but the most simple scripts, but I would probably start by grabbing all variables in a package and grouping them by typeglobs. Then apply a new, random name to all members of the typeglob. Then you'd have to look at lexical and dynamic variables. You'd have to use strict (can you imagine some poor fool using variables for variable names and trying to get this scheme to work?).

Hmm... you'd also have to do that for sub names. And you've have to ensure that you're not changing anything that's imported into the script. Oy, I don't know how workable that would be. It might be one of those simple projects that falls into place, but I suspect not. I don't have the time to tackle this right now (I'm on my 16th working day in a row), but if someone else wants to ...

Cheers,
Ovid

Join the Perlmonks Setiathome Group or just go the the link and check out our stats.

Log In?
Username:
Password:

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

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

    No recent polls found