Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine

a new useless obfu

by mt2k (Hermit)
on May 30, 2002 at 04:57 UTC ( #170311=obfuscated: print w/replies, xml ) Need Help??

Well, here's my second attempt (please notice the word 'attempt': I did not say 'success'!):

$..=chr$2-($1/5-1)while(' + + +'=~/([^.]+).([^.]+).?/g)or eval$.and exit

Replies are listed 'Best First'.
Re: (SPOILER) a new useless obfu
by meta4 (Monk) on May 30, 2002 at 19:19 UTC
    Poke A Dot.

    When I saw you using dot equal (.=) to poke characters into dollar dot ($.), along with all those dots in your secret string and your regular expression, I was hoping for some cool use of dots. I was kind of disappointed in what I found. Strangely enough, two of the dots in the regular expression, the ones that theoretically could match any character, actually match the dots in the string! I don't know whether this is intentional or not, but it's not very obfuscating.

    Points for stringing it all together in one statement though.

    Here is a de-obfuscated version. The obfuscated version pretty much does what it looks like it does.

    # your string of secret numbers $obfu = ' + +' +; # Split them on the periods @MagicNums = reverse split /\./, $obfu; while( @MagicNums != 0 ) { # Use the magic numbers two at a time $num1 = pop( @MagicNums ); $num2 = pop( @MagicNums ); # The mysterious formula to calulate the ascii value for # the next character $num = $num2 - ( $num1 / 5 - 1 ); # turn it into a character $char = chr( $num ); # String all the characters together to produce: # print "Just Another Perl Hacker"; $TheSecret .= $char; } # run the program eval $TheSecret;
      which is why I said it was an "attempt". I wasn't really trying for obfu I suppose, but the cool way that the actual code to be executed is "encoded" in numbers. Of course, it isn't hard to do... Just reverse that equation with the code in the string and you will get your numbers (as long as you add all those pesky dots.

      Granted, not really obfu (execpt maybe for that 'or eval $. and exit' part. Took a while to get the write operations ('or'/'and' to make it work right ;)

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (2)
As of 2022-10-04 23:35 GMT
Find Nodes?
    Voting Booth?
    My preferred way to holiday/vacation is:

    Results (20 votes). Check out past polls.