|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--BlowfishJ.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)
Deprecated. |
|
BlowfishECB(byte[] key,
int nOfs,
int nLen)
Extended constructor, allows partial key material passing. |
Method Summary | |
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. |
void |
decrypt(byte[] buf)
Deprecated. |
void |
decrypt(byte[] inBuf,
byte[] outBuf)
Deprecated. |
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. |
void |
decrypt(int[] buf)
Deprecated. |
void |
decrypt(int[] inBuf,
int[] outBuf)
Deprecated. |
void |
decrypt(int[] inBuf,
int nInPos,
int[] outBuf,
int nOutPos,
int nLen)
Decrypts an integer buffer to another integer buffer. |
void |
decrypt(long[] buf)
Deprecated. |
void |
decrypt(long[] inBuf,
int nInPos,
long[] outBuf,
int nOutPos,
int nLen)
Decrypts an long buffer to another long buffer. |
void |
decrypt(long[] inBuf,
long[] outBuf)
Deprecated. |
void |
encrypt(byte[] buf)
Deprecated. |
void |
encrypt(byte[] inBuf,
byte[] outBuf)
Deprecated. |
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. |
void |
encrypt(int[] buf)
Deprecated. |
void |
encrypt(int[] inBuf,
int[] outBuf)
Deprecated. |
void |
encrypt(int[] inBuf,
int nInPos,
int[] outBuf,
int nOutPos,
int nLen)
Encrypts an integer buffer to another integer buffer. |
void |
encrypt(long[] buf)
Deprecated. |
void |
encrypt(long[] inBuf,
int nInPos,
long[] outBuf,
int nOutPos,
int nLen)
Encrypts an long buffer to another long buffer. |
void |
encrypt(long[] inBuf,
long[] outBuf)
Deprecated. |
int |
encryptPrv(byte[] inBuf,
int nInPos,
byte[] outBuf,
int nOutPos,
int nLen)
|
static boolean |
selfTest()
Selftest routine, for instance to check for a valid class file loading. |
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, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int MAXKEYLENGTH
public static final int BLOCKSIZE
Constructor Detail |
public BlowfishECB(byte[] key)
key
- key material, up to MAXKEYLENGTH bytespublic BlowfishECB(byte[] key, int nOfs, int nLen)
key
- key material, up to MAXKEYLENGTH bytesnOfs
- where to start readingnLen
- number of bytesMethod Detail |
public void cleanUp()
public static boolean selfTest()
public boolean weakKeyCheck()
public 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 encryptpublic void encrypt(byte[] inBuf, byte[] outBuf)
inBuf
- buffer with plaintext dataoutBuf
- buffer to get the ciphertext datapublic void encrypt(byte[] buf)
buf
- buffer to encryptpublic void encrypt(int[] inBuf, int nInPos, int[] outBuf, int nOutPos, int nLen)
inBuf
- buffer with plaintext datanInPos
- where to start reading the plaintext dataoutBuf
- buffer to write the ciphertext datanOutPos
- where to start writing the ciphertext datanLen
- number of integers to encryptpublic void encrypt(int[] inBuf, int[] outBuf)
inBuf
- buffer with ciphertext dataoutBuf
- buffer to get the plaintext datapublic void encrypt(int[] buf)
buf
- buffer to decryptpublic void encrypt(long[] inBuf, int nInPos, long[] outBuf, int nOutPos, int nLen)
inBuf
- buffer with plaintext datanInPos
- where to start reading the plaintext dataoutBuf
- buffer to write the ciphertext datanOutPos
- where to start writing the ciphertext datanLen
- number of longs to decryptpublic void encrypt(long[] inBuf, long[] outBuf)
inBuf
- buffer with ciphertext dataoutBuf
- buffer to get the plaintext datapublic void encrypt(long[] buf)
buf
- buffer to decryptpublic 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 decryptpublic void decrypt(byte[] inBuf, byte[] outBuf)
inBuffer
- buffer with ciphertext dataoutBuffer
- buffer to get the plaintext datapublic void decrypt(byte[] buf)
buffer
- buffer to decryptpublic void decrypt(int[] inBuf, int nInPos, int[] outBuf, int nOutPos, int nLen)
inBuf
- buffer with ciphertext datanInPos
- where to start reading the ciphertext dataoutBuf
- buffer to get the plaintext datanOutPos
- where to start writing the plaintext datanLen
- number of integers to decryptpublic void decrypt(int[] inBuf, int[] outBuf)
inBuf
- buffer with ciphertext dataoutBuf
- buffer to get the plaintext datapublic void decrypt(int[] buf)
buf
- buffer to decryptpublic void decrypt(long[] inBuf, int nInPos, long[] outBuf, int nOutPos, int nLen)
inBuf
- buffer with ciphertext datanInPos
- where to start reading the ciphertext dataoutBuf
- buffer to write the plaintext datanOutPos
- where to start writing the plaintext datanLen
- number of longs to decryptpublic void decrypt(long[] inBuf, long[] outBuf)
inBuf
- buffer with ciphertext dataoutBuf
- buffer to get the plaintext datapublic void decrypt(long[] buf)
buf
- buffer to decrypt
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |