|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectch.ethz.ssh2.crypto.cipher.BlowFish
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.
Field Summary | |
private static int |
BLOCK_SIZE
|
private boolean |
doEncrypt
|
private static int[] |
KP
|
private static int[] |
KS0
|
private static int[] |
KS1
|
private static int[] |
KS2
|
private static int[] |
KS3
|
private int[] |
P
|
private static int |
P_SZ
|
private static int |
ROUNDS
|
private int[] |
S0
|
private int[] |
S1
|
private int[] |
S2
|
private int[] |
S3
|
private static int |
SBOX_SK
|
private byte[] |
workingKey
|
Constructor Summary | |
BlowFish()
|
Method Summary | |
private void |
Bits32ToBytes(int in,
byte[] b,
int offset)
|
private int |
BytesTo32bits(byte[] b,
int i)
|
private void |
decryptBlock(byte[] src,
int srcIndex,
byte[] dst,
int dstIndex)
Decrypt the given input starting at the given offset and place the result in the provided buffer starting at the given offset. |
private void |
encryptBlock(byte[] src,
int srcIndex,
byte[] dst,
int dstIndex)
Encrypt the given input starting at the given offset and place the result in the provided buffer starting at the given offset. |
private int |
F(int x)
|
java.lang.String |
getAlgorithmName()
|
int |
getBlockSize()
|
void |
init(boolean encrypting,
byte[] key)
initialise a Blowfish cipher. |
private void |
processTable(int xl,
int xr,
int[] table)
apply the encryption cycle to each value pair in the table. |
void |
reset()
|
private void |
setKey(byte[] key)
|
void |
transformBlock(byte[] in,
int inOff,
byte[] out,
int outOff)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
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 static final int ROUNDS
private static final int BLOCK_SIZE
private static final int SBOX_SK
private static final int P_SZ
private final int[] S0
private final int[] S1
private final int[] S2
private final int[] S3
private final int[] P
private boolean doEncrypt
private byte[] workingKey
Constructor Detail |
public BlowFish()
Method Detail |
public void init(boolean encrypting, byte[] key)
init
in interface BlockCipher
encrypting
- whether or not we are for encryption.key
- the key required to set up the cipher.
java.lang.IllegalArgumentException
- if the params argument is inappropriate.public java.lang.String getAlgorithmName()
public final void transformBlock(byte[] in, int inOff, byte[] out, int outOff)
transformBlock
in interface BlockCipher
public void reset()
public int getBlockSize()
getBlockSize
in interface BlockCipher
private int F(int x)
private void processTable(int xl, int xr, int[] table)
private void setKey(byte[] key)
private void encryptBlock(byte[] src, int srcIndex, byte[] dst, int dstIndex)
private void decryptBlock(byte[] src, int srcIndex, byte[] dst, int dstIndex)
private int BytesTo32bits(byte[] b, int i)
private void Bits32ToBytes(int in, byte[] b, int offset)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |