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

Hi great monks,
I have seen some of the perl scripts encrypted as pictures like camel.
1) how to encrypt the script?
2) is there any way to decrypt?
suggest me .......

Replies are listed 'Best First'.
Re: how to encryption script
by planetscape (Chancellor) on Jul 21, 2007 at 02:59 UTC

    It is not encryption per se, but obfuscation. If you want to hide your source, Perl, being interpreted rather than compiled, is probably not the language for you. To get some ideas on how to obfuscate your own programs, you might want to Super Search for "obfuscation", or browse the Obfuscated Code section. Super Searching for "perl golf" will probably also give you some useful ideas.


Re: how to encryption script
by CountZero (Bishop) on Jul 21, 2007 at 02:57 UTC
    It is called "obfuscation". Search on that in super-search and you will find more examples.

    It is not really about encrypting the script, rather more to show off your coding skills.

    It is possible because Perl is an (almost) free form language where you can add whitespace and line-feeds (almost) everywhere so you can lay-out your script in funny ways. To see through all this eye-candy, one usually employs the B::Deparse module which "decompiles" the script and shows a more classical representation of the script.


    A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James

Re: how to encryption script
by daxim (Curate) on Jul 21, 2007 at 05:22 UTC
Re: how to encryption script
by marto (Cardinal) on Jul 21, 2007 at 08:28 UTC