Just Another Perl Hacker

Sometimes writing small snippets of code can be meditative.

The other day, I realized that, even though I happen to be, among other things, Just Another Perl Hacker, I never bothered to write my own JAPH signature.  So I went ahead and wrote up a very simple (but effective) one.  Once it was complete, it dawned on me that other perl hackers may appreciate the ability to generate a signature like my own.

Since perl is all about code reuse and sharing, I figured I would write up a JAPH signature generator so that anyone can have an awesomely obfuscated JAPH signature like I do.

Firstly here’s my JAPH signature:

$_='Kvtu!Bopuifs!Qfsm!Ibdlfs-!K/!Cpccz!Mpqf{';
@_=split//;foreach(@_){print chr(ord()-1)}

You can run the JAPH signature by copy/pasting it to a text file (e.g., japh_sig.pl), and running with

perl japh_sig.pl

Which returns:

Just Another Perl Hacker, J. Bobby Lopez

You can also run the JAPH signature straight off the command line (with ‘perl -e’), but you have to replace the single quote characters in the string with double-quote characters, for example:

perl -e '$_="Kvtu!Bopuifs!Qfsm!Ibdlfs-!K/!Cpccz!Mpqf{";@_=split//;foreach(@_){print chr(ord()-1)}'

This is all just for fun of course, but if you do end up using my JAPH signature generator, please let me know by sending me a quick message on Twitter to @jbobbylopez.

Have Fun!

The JAPH Signature Generator

#!/usr/bin/env perl
##############################################
# USAGE:
#   perl japh.pl This is my awesome signature
#
# OUTPUT:
#   Your JAPH Signature:
#       $_='Uijt!jt!nz!bxftpnf!tjhobuvsf';
#       @_=split//;foreach(@_){print chr(ord()-1)} 
#
#   Returns:
#       This is my awesome signature
#
# AUTHOR: J. Bobby Lopez <jbl@jbldata.com>
##############################################

use feature say;

my $offset = 1;
my $signature = join (" ", @ARGV);
my $obfus_sig;

my @obfus = ();
my @sig = split //, $signature;

foreach my $c (@sig)
{
    push @obfus, ( chr ( ord($c) + $offset ) );
}

$obfus_sig = join ("", @obfus);

say <<"OUT";

Your JAPH Signature:
\t\$_='$obfus_sig';
\t\@_=split//;foreach(\@_){print chr(ord()-$offset)} 

OUT
print "Returns:\n\t";
@_=split//,$obfus_sig;foreach(@_){print chr(ord()-$offset)};
say;
1;

Leave a Reply

Your email address will not be published. Required fields are marked *