GOST in 417 bytes of PERL
© Vipul Ved Prakash, 1997-98. All Rights Reserved.

#!/usr/bin/perl -s sub F{$u=0;grep$u|=$S[$_][$_[0]>>$_*4&15]<<$_*4,reverse 0..7;$u<<11|$u>>21}sub R {int$_[0]*rand}sub N{vec$_[0],$_[1]/4,32}$e=join'',<>;@b=@t=0..15;for(;$i<length $p;$i+=4){srand($s^=N$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$e){$v=N$e,$a;$w=N$e,( $a+=8)-4;grep$q++%2?$v^=F$w+$K[$_]:($w^=F$v+$K[$_]) ,$d?(@h,(@o)x3):((@h)x3,@o); $_.=pack N2,$w,$v}print -------------------------------------------------------------------------------- SPECS USAGE -------------------------------------------------------------------------------- Cipher GOST (28147-89). gostcrypt -e -p=password <plain.txt> Mode Simple Substitution Mode. gostcrypt -d -p=password <crypt.txt> Key Length 610 bits. -------------------------------------------------------------------------------- Obfuscated version of the code, earned a 'dishonorable mention' in the 3rd Obfuscated Perl Contest. You can admire the "leaping dolphin" here. :-)


Soviet Encryption Algorithm
(GOST 28147-89)

GOST is a 64-bit symmetric cipher from the former Soviet Union. It uses a 256 bit key and some additional secret information in form of SBOX permutations. The details of the algorithm were published in 1990 as the Soviet Standard - GOST 28147-89. The algorithm provides flexible security (bad SBOXes can compromise the plain text) and can be implemented in both hardware and software.

Papers

Original GOST Specs translated in English by Josef Pieprzyk and Leonid Tombak GOST Algorithm specs, GOST in Simple Substitution Mode, Stream Mode, Stream Mode with feedback and Authentication Mode.

Further Comments on GOST : Mathematical analysis Description of GOST, General Properties of GOST, Avalanche Characterstic of GOST adder, Cyclic shifts in GOST and Selection of SBOXes.

English Translation of GOST Specs by Aleksandr Malchik Algorithm Structure, Electronic Codebook Mode, Output Feedback Mode, Cipher Feedback Mode, Authentication Mode, Flowcharts.

GOST Hash Function English translation of the GOST Hash function standard (GOST R 34.11-94) by Michael Roe of Cambridge University. Incomplete.

Software
Gostcrypt - GOST in 417 bytes of PERL Simple Substitution Mode. The KSU (256 bit Key Unit) and SBOX permutations are generated from the pass phrase. Vipul Ved Prakash, 1997.

Gost.pm A PERL 5 Module based on gostcrypt. Still undocumented. Vipul Ved Prakash, 1997.

Gost.c. C Implementation.

GOST for Windows GOST implementation for Windows 3.x, Divya Mahajan and Vipul Ved Prakash, 1995.

GOST for DOS GOST implementation for MS-DOS. Vipul Ved Prakash, 1995.


Web design and architecture, Vipul Ved Prakash.