Blow Fish Algorithm
Blow Fish Algorithm
Introduction:
An encryption algorithm plays an important role in securing the data in storing or
transferring it. The encryption
algorithms are categorized into Symmetric (secret) and
Asymmetric (public) keys encryption.
In Symmetric key encryption or secret key encryption [1], only one key is used for
both encryption and decryption of data.
In asymmetric key encryption or public key encryption [1] uses two keys, one for
encryption and other for decryption.
Eg: RSA
Secure: The key length is variable ,it can be in the range of 32~448 bits: default
128 bits key length.
It is suitable for applications where the key does not change often, like
communication link or an automatic file encryptor.
Unpatented
and
royality-free.
2.1.1 Key-expansion:
It will converts a key of at most 448 bits into several subkey arrays totaling 4168
bytes. Blowfish uses large number of subkeys.
These keys are generate earlier to any data encryption or decryption.
The p-array consists of 18, 32-bit subkeys:
P1,P2,.,P18
Four 32-bit S-Boxes consists of 256 entries each:
S1,0, S1,1,. S1,255
2.
3.
4.
5.
6.
7.
Initialize first the P-array and then the four S-boxes, in order, with a fixed string. This
string consists of the hexadecimal digits of pi (less the initial 3): P1 = 0x243f6a88, P2 =
0x85a308d3, P3 = 0x13198a2e, P4 = 0x03707344, etc.
XOR P1 with the first 32 bits of the key, XOR P2 with the second 32-bits of the key,
and so on for all bits of the key (possibly up to P14). Repeatedly cycle through the key bits
until the entire P-array has been XORed with key bits. (For every short key, there is at least
one equivalent longer key; for example, if A is a 64-bit key, then AA, AAA, etc., are
equivalent keys.)
Encrypt the all-zero string with the Blowfish algorithm, using the subkeys described
in steps (1) and (2).
Replace P1 and P2 with the output of step (3).
Encrypt the output of step (3) using the Blowfish algorithm with the modified
subkeys.
Replace P3 and P4 with the output of step (5).
Continue the process, replacing all entries of the P array, and then all four S-boxes in
order, with the output of the continuously changing Blowfish algorithm.
In total, 521 iterations are required to generate all required subkeys. Applications can store
the subkeys rather than execute this derivation process multiple times.
Swap XL and xR
Swap XL and xR (Undo the last swap.)
xR = xR XOR P17
xL = xL XOR P18
Recombine xL and xR
Note: For more details about the Blowfish Encryption Algorithm, refer "References" tab
File encryption and wipe utility for all Win32 systems. File browser, job automation, auto
password confirmation,
secure key setup with SHA-1, and data compression with LZSS. Uses Blowfish, Twofish,
and Yarrow. Open source.
Note:
For more information on Blowfish available given below,
Blow fish PPT file