public class

BlowFish

extends Object
implements BlockCipher
java.lang.Object
   ↳ com.trilead.ssh2.crypto.cipher.BlowFish

Class Overview

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.

Summary

Constants
int BLOCK_SIZE
int P_SZ
int ROUNDS
int SBOX_SK
Fields
private static final int[] KP
private static final int[] KS0
private static final int[] KS1
private static final int[] KS2
private static final int[] KS3
private final int[] P
private final int[] S0
private final int[] S1
private final int[] S2
private final int[] S3
private boolean doEncrypt
private byte[] workingKey
Public Constructors
BlowFish()
Public Methods
String getAlgorithmName()
int getBlockSize()
void init(boolean encrypting, byte[] key)
initialise a Blowfish cipher.
void reset()
final void transformBlock(byte[] in, int inOff, byte[] out, int outOff)
[Expand]
Inherited Methods
From class java.lang.Object
From interface com.trilead.ssh2.crypto.cipher.BlockCipher

Constants

private static final int BLOCK_SIZE

Constant Value: 8 (0x00000008)

private static final int P_SZ

Constant Value: 18 (0x00000012)

private static final int ROUNDS

Constant Value: 16 (0x00000010)

private static final int SBOX_SK

Constant Value: 256 (0x00000100)

Fields

private static final int[] KP

private static final int[] KS0

private static final int[] KS1

private static final int[] KS2

private static final int[] KS3

private final int[] P

private final int[] S0

private final int[] S1

private final int[] S2

private final int[] S3

private boolean doEncrypt

private byte[] workingKey

Public Constructors

public BlowFish ()

Public Methods

public String getAlgorithmName ()

public int getBlockSize ()

public void init (boolean encrypting, byte[] key)

initialise a Blowfish cipher.

Parameters
encrypting Whether or not we are for encryption.
key The key required to set up the cipher.
Throws
IllegalArgumentException if the params argument is inappropriate.

public void reset ()

public final void transformBlock (byte[] in, int inOff, byte[] out, int outOff)

Parameters
in
inOff
out
outOff