Encryption and Decryption Using Blow Fish Algorithm

Embed Size (px)

Citation preview

  • 8/11/2019 Encryption and Decryption Using Blow Fish Algorithm

    1/6

    1. Encryption and decryption using Blow Fish algorithm

    Abstract:

    Blowfish, a new secret-key block cipher, is proposed. It is a Feistel network, iterating a

    simple encryption function 16 times. The block size is 64 bits, and the key can be any

    length up to 448 bits. Although there is a complex initialization phase required before any

    encryption can take place, the actual encryption of data is very efficient on large

    microprocessors.

    The cryptographic community needs to provide the world with a new encryption standard.

    DES [16], the workhorse encryption algorithm for the past fifteen years, is nearing the end

    of its useful life. Its 56-bit key size is vulnerable to a brute-force attack [22], and recent

    advances in differential cryptanalysis [1] and linear cryptanalysis [10] indicate that DES is

    vulnerable to other attacks as well.

    If the world is to have a secure, unpatented, and freely- available encryption algorithm by

    the turn of the century, we need to develop several candidate encryption algorithms now.

    These algorithms can then be subjected to years of public scrutiny and cryptanalysis. Then,

    the hope is that one or more candidate algorithms will survive this process, and can

    eventually become a new standard.

    This paper discusses the requirements for a standard encryption algorithm. While it may notbe possible to satisfy all requirements with a single algorithm, it may be possible to satisfy

    them with a family of algorithms based on the same cryptographic principles

    Existing System:

    Advanced Encryption Standard was proposed by National Institute of Standard and

    technology (NIST) in order to replace DES. The only known attack to AES is the brute force

    attack that allows an attacker to test combination of characters in order to break the

    security. However, Brute Force is not an easy job even for a super computer if the number

    of combination is arbitrarily high.

  • 8/11/2019 Encryption and Decryption Using Blow Fish Algorithm

    2/6

    Proposed system:

    Blowfish is the most commonly used algorithm around the world, developed by Bruce

    Schneier, the president of Counterpane Systems, a firm that deals with cryptography and

    security. Blowfish is known to be the secret-key cipher that uses a variable number of bits

    ranging from 16 - 448 bits and encrypts the data 16 times to make it impossible for a

    hacker to decrypt it. Until now, no attack has been discovered to break the blowfish

    encryption.

    Performance Comparison

    As far as performance comparison is confirmed, AES and blowfish perform better in

    comparison to others.

    For a data of about 256 MB, following were the results.

    The performance of each algorithm depends on the configuration of the system used. These

    tests were conducted on P4 2.1 GHZ CPU running Windows XP SP1.

    The above test clearly shows that Blowfishis the best of all, where the performance is very

    high. Also, AES had a high performance rate in comparison to DES and 3DES, and the

    throughput is almost 1/3rdof them.

    Module Discription:

    Encryption Algorithm:

    Blowfish is a variable-length key block cipher. It is suitable for applications where thekey does not change often, like a communications link or an automatic file encryptor. It is

    significantly faster than most encryption algorithms when implemented on 32-bit

    microprocessors with large data caches.

    Encryption

    Blowfish has 16 rounds.The input is a 64-bit data element, x.

    Divide x into two 32-bit halves: xL, xR.

    Then, for i = 1 to 16:

  • 8/11/2019 Encryption and Decryption Using Blow Fish Algorithm

    3/6

    xL = xL XOR Pi

    xR = F(xL) XOR xR

    Swap xL and xR

    After the sixteenth round, swap xL and xR again to undo the last swap.Then, xR = xR XOR P17 and xL = xL XOR P18.

    Finally, recombine xL and xR to get the ciphertext.

    Decryption Algorithm;

    The decryption algorithm of a block cipher should be identical to encryption algorithm step by

    step in reverse order. But for Blowfish cipher, the encryption algorithm is so well designed, thatthe decryption algorithm is identical to the encryption algorithm step by step in the same order,only with the sub-keys applied in the reverse order.

    To help us to approve the decryption algorithm, we have to write the encryption algorithm andthe decryption algorithm with temporary variables.

    Encryption algorithm with temporary variables:

    Input:

    T: 64 bits of clear text

    P1, P2, ..., P18: 18 sub-keys

    F(): Round function

    Output:

    C: 64 bits of cipher text

    Algorithm:

    (L0, R0) = T, dividing T into two 32-bit parts

    L1 = L0 XOR P1

    R2 = R0 XOR F(L1) XOR P2

    L3 = L1 XOR F(R2) XOR P3

    R4 = R2 XOR F(L3) XOR P4

    L5 = L3 XOR F(R4) XOR P5R6 = R4 XOR F(L5) XOR P6

    L7 = L5 XOR F(R6) XOR P7

    R8 = R6 XOR F(L7) XOR P8

    L9 = L7 XOR F(R8) XOR P9

    R10 = R8 XOR F(L9) XOR P10

    L11 = L9 XOR F(R10) XOR P11

    R12 = R10 XOR F(L11) XOR P12

    L13 = L11 XOR F(R12) XOR P13

    R14 = R12 XOR F(L13) XOR P14

  • 8/11/2019 Encryption and Decryption Using Blow Fish Algorithm

    4/6

    L15 = L13 XOR F(R14) XOR P15

    R16 = R14 XOR F(L15) XOR P16

    L17 = L15 XOR F(R16) XOR P17

    R18 = R16 XOR P18

    C = (R18, L17)

    Decryption algorithm with temporary variables:

    Input:

    CC: 64 bits of cipher text

    P1, P2, ..., P18: 18 sub-keys

    F(): Round function

    Output:

    TT: 64 bits of clear text

    Algorithm:

    (LL0, RR0) = CC, dividing CC into two 32-bit parts

    LL1 = LL0 XOR P18

    RR2 = RR0 XOR F(LL1) XOR P17

    LL3 = LL1 XOR F(RR2) XOR P16

    RR4 = RR2 XOR F(LL3) XOR P15

    LL5 = LL3 XOR F(RR4) XOR P14

    RR6 = RR4 XOR F(LL5) XOR P13

    LL7 = LL5 XOR F(RR6) XOR P12

    RR8 = RR6 XOR F(LL7) XOR P11

    LL9 = LL7 XOR F(RR8) XOR P10

    RR10 = RR8 XOR F(LL9) XOR P9

    LL11 = LL9 XOR F(RR10) XOR P8

    RR12 = RR10 XOR F(LL11) XOR P7

    LL13 = LL11 XOR F(RR12) XOR P6

    RR14 = RR12 XOR F(LL13) XOR P5

    LL15 = LL13 XOR F(RR14) XOR P4

    RR16 = RR14 XOR F(LL15) XOR P3LL17 = LL15 XOR F(RR16) XOR P2

    RR18 = R16 XOR P1

    TT = (RR18, LL17)

    Here is how to approve the decryption algorithm:

    Let:

    T: 64 bits of clear text

    C: 64 bits of cipher text encrypted from T

    CC: 64 bits of cipher text

    TT: 64 bits of clear text decrypted from CC

    If:

    CC = C

    Then:

    TT = T

    Prove:

    (LL0, RR0) = CC Initializing step in decryption

    = C Assumption of CC = C

  • 8/11/2019 Encryption and Decryption Using Blow Fish Algorithm

    5/6

    = (R18, L17) Finalizing step in encryption

    LL1 = LL0 XOR P18 Applying P18 in decryption

    = R18 XOR P18 Previous result

    = R16 XOR P18 XOR P18 Applying P18 in encryption

    = R16

    RR2 = RR0 XOR F(LL1) XOR P17

    Applying P17 in decryption

    = L17 XOR F(R16) XOR P17

    Previous result

    = L15 XOR F(R16) XOR P17 XOR F(R16) XOR P17

    Applying P17 in encryption

    = L15

    ......

    LL17 = LL15 XOR F(RR16) XOR P2

    Applying P2 in decryption

    = R2 XOR F(L1) XOR P2

    Previous result= R0 XOR F(L1) XOR P2 XOR F(L1) XOR P2

    Applying P2 in encryption

    = R0

    RR18 = RR16 XOR P1 Applying P1 in decryption

    = L1 XOR P1 Previous result

    = L0 XOR P1 XOR P1 Applying P1 in encryption

    = L0

    TT = (RR18, LL17) Finalizing step in decryption

    = (L0, R0) Initializing step in encryption

    = T

    Software Requirements:

    Operating System : Windows XP

    Front End : Java Swing

    Programming tool : net beans

    Hardware Requirements:

    Processor : Intel Pentium IV

    Cache Memory : 1MB

    HDD : 40 GB

    RAM : 512 MB

    Processor Speed : 600 MHz

  • 8/11/2019 Encryption and Decryption Using Blow Fish Algorithm

    6/6

    Display Type : VGA

    Mouse : Logitech

    Monitor : 15 Samsung Color Monitor