com.trilead.ssh2.crypto.cipher

Class BlowFish

Implemented Interfaces:
BlockCipher

public class BlowFish
extends java.lang.Object
implements BlockCipher

A class that provides Blowfish key encryption operations, such as encoding data and generating keys. All the algorithms herein are from Applied Cryptography and implement a simplified cryptography interface.

Constructor Summary

BlowFish()

Method Summary

String
getAlgorithmName()
int
getBlockSize()
void
init(boolean encrypting, byte[] key)
initialise a Blowfish cipher.
void
reset()
void
transformBlock(byte[] in, int inOff, byte[] out, int outOff)

Constructor Details

BlowFish

public BlowFish()

Method Details

getAlgorithmName

public String getAlgorithmName()

getBlockSize

public int getBlockSize()
Specified by:
getBlockSize in interface BlockCipher

init

public void init(boolean encrypting,
                 byte[] key)
initialise a Blowfish cipher.
Specified by:
init in interface BlockCipher
Parameters:
encrypting - whether or not we are for encryption.
key - the key required to set up the cipher.

reset

public void reset()

transformBlock

public final void transformBlock(byte[] in,
                                 int inOff,
                                 byte[] out,
                                 int outOff)
Specified by:
transformBlock in interface BlockCipher