It's late at night, and I've just completed my first JAPH (part of my exam-revision procrastination project). Comments are most welcome, whether positive or negative!
Hope you like it!
#!/usr/bin/perl -w
@k=split//,'colin@colinhorne.co.uk';
@p=sub{$_=shift;my@r;for(split/,/){push@r,sub{my@r;$_=shift;for(/.{8}/
+g){push@r
,chr(eval"0b$_")}@r}->(sprintf('%032b',eval("0x$_")))}@r}->("291a1f1d,
+4e210d00"
.",18010b1a,4f220b17,4243274f,16080a1e");{my$buf=0;my$count=0;sub d{$b
+uf=(($buf
<<1)|($_?1:0))&255;print chr($buf)unless(++$count%8)}}sub{my$f=shift;f
+or(0..$#p
){for my$b(map{2**$_}(reverse(0..7))){local$_=(ord($k[$_%$#k])^ord($p[
+$_]))&$b;
&$f}}}->(\&d);print"\n";
(PS: I'm aware of one bug to do with padding thingies to 4 bytes width, but I don't really have time to fix it)
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.