WanCrypt
Schematic
Text permutation.
WanCrypt uses the cipher key (entered by the
user) and mixes with an random IV key. It then creates 2 arrays ( X and N
)
N is holding 40.000 8 bits subkeys. While the X array key is expanded to the
same size as the text length.
The X subkeys are use to permute the plain text. Permute is the same as mixing.
If the plain text is "Meet me to morrow at none.",
the permuted text can look like : "namt m.Mno m eontwre ot" as you
can see the period (.) and spaces are also replaced.
Permuting the text before encryption protects agains nown plain text attacks,
man in the middle attack and makes it very hard to solve the cipher.
Random IV (initialization Vector).
WanCrypt makes a random IV, the reason for this is to make sure using the
same text and cipher key are encrypted differently.
The IV does not need to be very random, just different for every encryption
(in asymmetric encryption it most be very random).
It is not kept secret and are in fact added to the cipher.
The IV are used to give solid protection against reused key attack, a very
viscous attack against stream ciphers.
Click her to
see visualization of how WanCrypt works.
The key scheduling algorithm is slow (around 1/4 sec
on a P4 3Ghz).
However in a stream cipher it is not important to have a very fast algorithm
as long as we are talking about text encryption.
Her is the
source code for the key scheduling algorithm.