|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectewe.security.BlowfishECB
Implementation of the Blowfish encryption algorithm in ECB mode.
| Field Summary | |
static int |
BLOCKSIZE
block size of this cipher (in bytes) |
static int |
MAXKEYLENGTH
maximum possible key length in bytes |
| Constructor Summary | |
BlowfishECB(byte[] key)
The default constructor, using a simple binary key. |
|
BlowfishECB(byte[] key,
int nOfs,
int nLen)
|
|
| Method Summary | |
static int |
byteArrayToInt(byte[] buf,
int nOfs)
|
void |
cleanUp()
To clear data in the boxes before an instance is freed, the actual value of this call can be argued, yet still nice to have it. |
int |
decrypt(byte[] inBuf,
int nInPos,
byte[] outBuf,
int nOutPos,
int nLen)
Decrypts a byte buffer to another buffer, extra misaligned data will not be processed. |
int |
encrypt(byte[] inBuf,
int nInPos,
byte[] outBuf,
int nOutPos,
int nLen)
Encrypts a byte buffer to another buffer, extra misaligned data will not be processed. |
protected int |
encryptPrv(byte[] inBuf,
int nInPos,
byte[] outBuf,
int nOutPos,
int nLen)
|
void |
initialize(byte[] key,
int nOfs,
int nLen)
Initializes the instances, but does not really reset it since the PBOXes are not reset. |
void |
reset()
Reset the Encryptor/Decryptor using the last key used to initialize it. |
void |
reset(byte[] key,
int nOfs,
int nlen)
Reset the Encryptor/Decryptor using a specific key. |
boolean |
weakKeyCheck()
To check if an instance actually was using a weak key, if so it might be better to use a different key or salt the existing one as alternative. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, toString |
| Field Detail |
public static final int MAXKEYLENGTH
public static final int BLOCKSIZE
| Constructor Detail |
public BlowfishECB(byte[] key)
key - key material, up to MAXKEYLENGTH bytes
public BlowfishECB(byte[] key,
int nOfs,
int nLen)
BlowfishJ.BlowfishECB#initialize(byte[], int, int)| Method Detail |
public void reset()
public void reset(byte[] key,
int nOfs,
int nlen)
public static final int byteArrayToInt(byte[] buf,
int nOfs)
public void initialize(byte[] key,
int nOfs,
int nLen)
key - key material, up to MAXKEYLENGTH bytesnOfs - where to start readingnLen - number of bytespublic void cleanUp()
public boolean weakKeyCheck()
protected int encryptPrv(byte[] inBuf,
int nInPos,
byte[] outBuf,
int nOutPos,
int nLen)
public int encrypt(byte[] inBuf,
int nInPos,
byte[] outBuf,
int nOutPos,
int nLen)
inBuf - buffer with plaintext datanInPos - where to start reading the plaintext dataoutBuf - buffer to put the ciphertext datanOutPos - where to start writing the ciphertext datanLen - number of bytes to encrypt
public int decrypt(byte[] inBuf,
int nInPos,
byte[] outBuf,
int nOutPos,
int nLen)
inBuf - buffer with ciphertext datanInPos - where to start reading the ciphertext dataoutBuf - buffer to put the plaintext datanOutPos - where to start writing the plaintext datanLen - number of bytes to decrypt
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||