Cryptography Reference
In-Depth Information
Listing 4-9 FEAL key-generating function, f K
##########################################
# FEAL key generating function
##########################################
def fk(alpha, beta):
# Split alpha and beta
a = demux(alpha)
b = demux(beta)
# Express output as four 8-bit values
fs = [0,0,0,0]
# Calculate the four 8-bit values
fs[1] = sbox(a[0] ^ a[1], a[2] ^ a[3] ^ b[0], 1)
fs[2] = sbox(a[2] ^ a[3], fs[1] ^ b[1], 0)
fs[0] = sbox(a[0], fs[1] ^ b[2], 0)
fs[3] = sbox(a[3], fs[2] ^ b[3], 1)
return mux(fs)
Although we will get into more detailed cryptanalysis of FEAL later, there are a few things to note.
It's easy to see that FEAL is almost more complicated than DES: It takes more space to explain and requires
more bits and pieces. To give FEAL some credit, most of the operations are indeed very fast: They usually op-
erate on a small number of bits, so that they can be implemented in one machine code instruction.
4.8 Blowfish
Blowfish is another Feistel cipher, created by Bruce Schneier in 1994 [14, 15]. According to Schneier, it was
designed to be fast, simple, small, and have a variable key [16]. The following description is based mostly on
his description in Reference [16].
Blowfish has a slight variant of the Feistel structure previously used and operates on 64-bit blocks. It uses
expansive S-boxes and other simple operations. There are two features that differentiate it from DES:
• Blowfish's S-boxes are key-dependent — the actual substitution values are regenerated whenever the al-
gorithm is rekeyed. It has four dynamic 8-bit to 32-bit S-boxes.
• It has a variable length key, up to 448 bits.
The basic Blowfish algorithm consists of two phases: calculating the key schedule (33,344 bits derived from
up to 448 bits of key), and performing the encryption or decryption algorithm.
4.8.1 Blowfish Key Schedule
Schneier refers to the subkeys, generated from the main key, as 18 32-bit keys: P 1 , P 2 , ... , P 18 . The key schedul-
ing algorithm also calculates the S-box, since its values are completely determined by the key itself.
Blowfish Key Scheduling
The P -values and S-box values for the main encryption are calculated based on an input key (of up to a length
of 448 bits) and the hexadecimal digits of π.
 
Search WWH ::




Custom Search