gnu.crypto.cipher

Class Blowfish

Implemented Interfaces:
Cloneable, IBlockCipher, IBlockCipherSpi

public class Blowfish
extends BaseCipher

Blowfish is a 16-round, 64-bit Feistel cipher designed by Bruce Schneier. It accepts a variable-length key of up to 448 bits.

References:

  1. Schneier, Bruce: Applied Cryptography, Second Edition, 336--339, 647--654 (1996 Bruce Schneier).
  2. The Blowfish Encryption Algorithm.

Field Summary

(package private) static int[]
KS0
Initial value of S-box 1.

Fields inherited from class gnu.crypto.cipher.BaseCipher

currentBlockSize, currentKey, defaultBlockSize, defaultKeySize, lock, name

Fields inherited from interface gnu.crypto.cipher.IBlockCipher

CIPHER_BLOCK_SIZE, KEY_MATERIAL

Constructor Summary

Blowfish()

Method Summary

Iterator
blockSizes()
Object
clone()
void
decrypt(byte[] in, int i, byte[] out, int o, Object k, int bs)
void
encrypt(byte[] in, int i, byte[] out, int o, Object k, int bs)
Iterator
keySizes()
Object
makeKey(byte[] k, int bs)
boolean
selfTest()

Methods inherited from class gnu.crypto.cipher.BaseCipher

clone, currentBlockSize, decryptBlock, defaultBlockSize, defaultKeySize, encryptBlock, init, name, reset, selfTest, testKat, testKat

Field Details

KS0

(package private) static final int[] KS0
Initial value of S-box 1.

Constructor Details

Blowfish

public Blowfish()

Method Details

blockSizes

public Iterator blockSizes()
Specified by:
blockSizes in interface IBlockCipher
blockSizes in interface IBlockCipherSpi

clone

public Object clone()
Specified by:
clone in interface IBlockCipher
Overrides:
clone in interface BaseCipher

decrypt

public void decrypt(byte[] in,
                    int i,
                    byte[] out,
                    int o,
                    Object k,
                    int bs)
Specified by:
decrypt in interface IBlockCipherSpi

encrypt

public void encrypt(byte[] in,
                    int i,
                    byte[] out,
                    int o,
                    Object k,
                    int bs)
Specified by:
encrypt in interface IBlockCipherSpi

keySizes

public Iterator keySizes()
Specified by:
keySizes in interface IBlockCipher
keySizes in interface IBlockCipherSpi

makeKey

public Object makeKey(byte[] k,
                      int bs)
Specified by:
makeKey in interface IBlockCipherSpi

selfTest

public boolean selfTest()
Specified by:
selfTest in interface IBlockCipher
selfTest in interface IBlockCipherSpi
Overrides:
selfTest in interface BaseCipher

Copyright © 2001, 2002, 2003 Free Software Foundation, Inc. All Rights Reserved.