blowfish algorithm1

15

Upload: saad-khaliq

Post on 06-Dec-2015

259 views

Category:

Documents


0 download

DESCRIPTION

This algorithm used in Network Security.

TRANSCRIPT

BLOWFISH ENCRYPTION ALGORITHM

Basic IntroductionBlowfish is an encryption algorithm method designed by Bruce Schneier in 1993 .Blowfish algorithm has gained lots of popularity due to its free license.It uses a variable length key, from 32 to 448-bit.

Blowfish Encryption Blowfish takes 64 bit plaintext blocks as input and creates as output 64 bit ciphertext. Input block is split in half L0 and R0 each consisting of 32 bits. There are 16 rounds of XOR ing and operation of function F.

Graphical Representation of Function F

S-Boxes There are four S-Boxes with 256 entries each:

S1,0, S1,1,…........., S1,255; S2,0, S2,1,………..., S2,255; S3,0, S3,1,…….….., S3,255; S4,0, S4,1,…….….., S4,255.

Generation of Sub-Keys, S-Boxes and P-Boxes

Step I:

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):

Pi[0] = 0x243f6a88;

Pi[1] = 0x85a308d3;

Pi[2] = 0x13198a2e;

Pi[3] = 0x3707344;

...

The array holds 1042 sections of Pi.

Step II:

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.

Step III:

There should now be a 64 bit block (of all zeros for the first case). Take this block and encrypt it using the Blowfish Process.

Step IV:

Replace P1 and P2 with the output of Step III.

Step V:

Encrypt the output of Step III using the Blowfish algorithm with the modified sub-keys.

Step VI:

Replace P3 and P4 with the output of Step V.

Step VII:

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.

Note:In total, 521 iterations are required to generate all required sub-keys. Applications can store the sub-keys rather than execute this derivation process multiple times.

Blowfish Decryption Decryption for Blowfish is relatively straight forward. Decryption works in the same algorithmic direction as encryption beginning with the ciphertext as input. However, sub-keys are used in reverse order.

Benefits of Blowfish Blowfish has been known to be very fast and compact only requiring 5KB of RAM. Variability exist in key length and Blowfish is relatively simple to implement. Provides a very strong avalanche affect in that every left side input bit affects every right side input bit per round.

Questions?