Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things

A Prefect Obfuscation

by thabenksta (Pilgrim)
on May 02, 2001 at 01:01 UTC ( #77125=obfuscated: print w/replies, xml ) Need Help??

Coincidentally, this is my 42nd writeup.

#!/usr/local/bin/perl -w use strict; $_="112|101|114|108|32|45|101|32|39|36|95|61|34|49|57|46|56|79|50|48| 46|49|92|110|49|79|50|46|49|79|50|46|49|79|56|46|52|79|56|46|52|79|57| 46|49|79|50|46|49|79|50|46|49|79|49|92|110|49|46|49|79|49|46|49|79|49| 46|49|79|54|46|51|79|49|54|46|51|79|55|46|49|79|49|46|49|79|49|46|49| 79|49|46|49|92|110|10|50|46|51|79|53|46|50|79|50|50|46|50|79|54|46|51| 79|50|46|49|92|110|49|46|49|79|51|46|51|79|49|46|49|79|50|54|46|49|79| 50|46|51|79|51|46|49|79|49|46|49|92|110|50|46|49|79|49|46|49|79|51|46| 49|79|50|56|46|49|79|52|46|49|79|49|46|49|79|50|46|49|92|110|10|51|46| 49|79|52|46|49|79|50|56|46|49|79|53|46|49|79|51|46|49|92|110|51|46|49| 79|51|46|49|79|51|48|46|49|79|52|46|49|79|51|46|49|92|110|51|46|49|79| 51|46|49|79|51|48|46|49|79|52|46|49|79|51|46|49|92|110|50|46|49|79|52| 46|49|79|51|48|46|49|79|52|46|49|79|51|46|49|92|110|10|49|46|55|79|53| 46|50|79|49|54|46|50|79|53|46|55|79|50|46|49|92|110|55|46|49|79|52|46| 49|79|50|46|51|79|49|48|46|51|79|50|46|49|79|52|46|49|79|56|46|49|92| 110|56|46|49|79|52|46|49|79|52|46|49|48|79|52|46|49|79|52|46|49|79|57| 46|49|92|110|10|56|46|49|79|53|46|50|79|54|46|49|92|92|51|46|49|92|92| 51|46|50|79|53|46|49|79|57|46|49|92|110|57|46|49|79|54|46|52|79|51|46| 49|92|92|49|46|49|92|92|49|46|49|92|92|51|79|53|46|49|79|49|48|46|49| 92|110|49|48|46|50|79|56|46|52|79|49|92|92|49|46|49|92|92|49|46|49|92| 92|53|46|50|79|49|49|46|49|92|110|10|49|50|46|51|79|49|48|46|49|40|51| 95|49|41|49|46|51|79|49|51|46|49|92|110|49|53|46|52|79|56|46|52|79|49| 54|46|49|92|110|49|57|46|56|79|50|48|46|49|92|110|52|55|46|49|92|110| 49|56|46|49|68|49|79|49|78|49|84|49|46|49|80|49|65|49|78|49|73|49|67| 49|57|46|34|59|10|109|121|32|36|109|59|115|124|40|92|100|43|41|40|91| 94|92|100|93|41|124|102|111|114|40|109|121|32|36|105|61|49|59|36|105| 60|61|36|49|59|36|105|43|43|41|123|36|109|46|61|36|50|59|125|124|103| 101|59|112|114|105|110|116|32|36|109|59|39"; my $r = join '',map{chr;}split '\|';print `$r`;

There is more to this than first meets the eye.

Update: This my first, I would appriciate some criticism.

my $name = 'Ben Kittrell'; $name=~s/^(.+)\s(.).+$/\L$1$2/g; my $nick = 'tha' . $name . 'sta';

Replies are listed 'Best First'.
Re: A Prefect Obfuscation
by turnstep (Parson) on May 02, 2001 at 19:01 UTC

    A nice trick, but it is still not very obfuscated. Or rather, it's one of those "obfuscation through encoding" scripts that basically hides the real code away from those reading by some sort of encoding scheme. The backticks are a nice touch, but they are really the only obfuscated part. *Some* encoding is okay, but it should be limited to dead giveaway parts, such as text messages, and not the code itself. (See my Perl Racer code for an example that encodes the text messages but not the code itself)

    My quick test of a good obfuscation is: can I read through this and figure out what it does? In this case, the answer was "yes." I did think it was a usual map-chr sort of letter munging until I got to the end, however, so you get points for that. Making me decode the inside to get to the actual code, however, is not good. Just my $0.02. Everyone has individual styles and opinions about obfuscations.

Re: A Prefect Obfuscation
by beowulf (Scribe) on May 02, 2001 at 07:12 UTC
    Nice, but not very obfuscated. If instead of that big list of numbers at the beginning, you had a routine that generated that big long list of numbers, then it would be a heck of a lot better. But, don't ask me how to do that.

    The best thing about Perl is that you can do anything with it.
    The worst thing about Perl is that you can do anything with it.

      That big list of numbers, does generate a big list of numbers. Look closer.

      my $name = 'Ben Kittrell'; $name=~s/^(.+)\s(.).+$/\L$1$2/g; my $nick = 'tha' . $name . 'sta';

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (3)
As of 2023-06-09 14:57 GMT
Find Nodes?
    Voting Booth?
    How often do you go to conferences?

    Results (36 votes). Check out past polls.