Well, I'm Impressed
I found this at www.tpj.com. This is written in perl, and does encrption,
decryption, and looks like a dolphin.
This script didn't win the contest it was entered in, though I'm not sure
how.
I am a fan of perl. I really like perl. I use perl daily. I am not nearly
this good.
I would like to congratulate Vipul Ved Prakash for... this thing.
- Kevin
Vial Stats
Author: Vipul Ved Prakash.
Contact: mail@vipul.net
The Perl Code
#!/usr/bin/perl -s
sub R{int$_[0]||
return vec$_[1],$_[2]/4,32;int$_[0]*rand}($R)
=$^=~'([\]-\`])';sub F{$u=0;grep$u|=$S->[$_][$_[0]>>
$_*4&15]<<$_*4,reverse 0..7;$u<<11|$u>>21}$t=$e
||$d?join'',<>:(($p,$d)=($R,1),unpack u
,"(3=MCV7%2W'<`");@b=@t=0..15;for(
;$i<length$p;$i+=4){srand($s^=R$R,$p
,$i)}while($c<8){grep{push@b ,splice
@b,R(9),5}@t;$R[$c]=R(2 **32);@{
$S->[$c++]}=@b}@h=0..7;@o =reverse
@h;while($a<length
$t){$v=R$R,$t,$a;
$w=R$R,$t,($a+=8)-4;
grep$q++%2?$v
^=F$w+$R
[$$R]:( $w^=F$v+$R[$$R]),$d?(@h,(@o)
x3):(( @h)x3,@o);$_.=pack N2,$w,$v}
print
What It Does
The code is a diminutive implementation of the KGB block cipher, GOST, in
Simple Substitution Mode as described in the Soviet Standard (GOST 28147-89).
An English translation by Josef Pieprzyk and Leonid Tombak is available from
ftp://vipul.net/pub/gost/specs.ps.gz. (You don't really want to read this, a
functional description of the algorithm is included in this file.)
Besides implementing the encryption algorithm, the code also also computes
the key-store-unit and s-box permutations as a function of the pass-phrase.
This document is part of Incompetech.com. kevin@incompetech.com.
Also please visit my buddies at: Kelly Howlett Illustrations,
Craig Abrams,
and TubaPants!
Big chuncks of programming and a pile of behind-the-scenes things you can't see were done by The ninjas at Seppuku.net
This site uses elements available from www.MouseRunner.com, cooltext.com, and a couple bits from the silver lexus theme.
Here's some badges!
British Authors Bios, and The Movie Critic ©1996-2007 Laura MacLeod
Artist Bios ©1998-99 Steve Lange
Music, Photos, Renderings, Everything else ©1998-2007 Kevin MacLeod
|