JAPH – Awesome Code Obfuscation
by Martin on 6/06/2010Every so often I stumble across something that really just leaves me dumbfounded. The only valid response seems to be “… Fascinating!”
The latest is this clever JAPH consisting solely of keywords.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | not exp log srand xor s qq qx xor s x x length uc ord and print chr ord for qw q join use sub tied qx xor eval xor print qq q q xor int eval lc q m cos and print chr ord for qw y abs ne open tied hex exp ref y m xor scalar srand print qq q q xor int eval lc qq y sqrt cos and print chr ord for qw x printf each return local x y or print qq s s and eval q s undef or oct xor time xor ref print chr int ord lc foreach qw y hex alarm chdir kill exec return y s gt sin sort split |
In short; The Perl community has a meme going where you are supposed to write a snippet returning the String “just another perl hacker” in the most convoluted and obfuscated way possible.
This gem does exactly that. It’s beautiful in that there are no Strings in there, only valid Perl keywords, and it’s perfectly justified. For some reason this kind of useless stuff really appeals to me at a deep level. I fear a couple of hours may be lost to trying to create a clever JAAH.
There is 1 comment in this article: