With much hard work I have come up with a new package...
Crypt::1337, I feel it is my duty to give back to the community and what better than a new form of encryption only idiots could use? Now, keep in mind this is an alpha version, and does lose a bit of formatting... but returns messages in readble format...
package Crypt::1337;
use base Exporter;
@EXPORT = qw(to_1337 from_leet);
sub to_1337 {
my($str) = lc $_[0];
$str =~ s/\bto\b/2/g;
$str =~ s/ate/8/g;
$str =~ tr/letasbgo/13745690/;
$str;
};
sub from_leet {
@str = split /(\s+)/, lc $_[0];
for (@str) {
next if /\s/;
$_ = 'to' if $_ == 2;
$_ = 'a' if $_ == 4;
next if(/^\d+$/ && $_ !~ /3?1337/);
s/8/ate/g;
s/8/to/g;
tr/13745690/letasbgo/;
}
join '', @str;
}
and for an example script....
use Crypt::1337;
my $enc = to_1337("This is a test, later\n");
print $enc;
my $unenc = from_leet($enc);
print $unenc;
Enjoy your 1337 h4ckin9.
This is, of course, a joke... :)
- Ant
- Some of my best work - Fish Dinner
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.
|