public final class BlowfishCBC extends BlowfishECB
BLOCKSIZE, MAXKEYLENGTH
Constructor and Description |
---|
BlowfishCBC(byte[] bfkey)
constructor, stores a zero CBC IV
|
BlowfishCBC(byte[] bfkey,
byte[] initCBCIV)
constructor
|
BlowfishCBC(byte[] bfkey,
long lInitCBCIV)
constructor
|
Modifier and Type | Method and Description |
---|---|
void |
cleanUp()
cleans up all critical internals,
call this if you don't need an instance anymore
|
void |
decrypt(byte[] buffer)
decrypts a byte buffer (should be aligned to an 8 byte border) to itself
|
void |
decrypt(byte[] inbuffer,
byte[] outbuffer)
decrypts a byte buffer (should be aligned to an 8 byte border)
to another buffer (of the same size or bigger)
|
void |
decrypt(int[] buffer)
decrypts an int buffer (should be aligned to a
two integer border)
|
void |
decrypt(int[] inbuffer,
int[] outbuffer)
decrypts an integer buffer (should be aligned to an
two integer border) to another int buffer (of the same size or bigger)
|
void |
decrypt(long[] buffer)
decrypts a long buffer to itself
|
void |
decrypt(long[] inbuffer,
long[] outbuffer)
decrypts a long buffer to another long buffer (of the same size or bigger)
|
void |
encrypt(byte[] buffer)
encrypts a byte buffer (should be aligned to an 8 byte border) to itself
|
void |
encrypt(byte[] inbuffer,
byte[] outbuffer)
encrypts a byte buffer (should be aligned to an 8 byte border)
to another buffer (of the same size or bigger)
|
void |
encrypt(int[] buffer)
encrypts an integer buffer (should be aligned to an
|
void |
encrypt(int[] inbuffer,
int[] outbuffer)
encrypts an int buffer (should be aligned to an
two integer border) to another int buffer (of the same
size or bigger)
|
void |
encrypt(long[] buffer)
encrypts a long buffer to itself
|
void |
encrypt(long[] inbuffer,
long[] outbuffer)
encrypts a long buffer to another long buffer (of the same size or bigger)
|
long |
getCBCIV()
get the current CBC IV (for cipher resets)
|
void |
getCBCIV(byte[] dest)
get the current CBC IV (for cipher resets)
|
void |
setCBCIV(byte[] newCBCIV)
set the current CBC IV (for cipher resets)
|
void |
setCBCIV(long lNewCBCIV)
set the current CBC IV (for cipher resets)
|
selfTest
public BlowfishCBC(byte[] bfkey)
bfkey
- key material, up to MAXKEYLENGTH bytespublic BlowfishCBC(byte[] bfkey, long lInitCBCIV)
bfkey
- key material, up to MAXKEYLENGTH byteslInitCBCIV
- the CBC IVpublic BlowfishCBC(byte[] bfkey, byte[] initCBCIV)
bfkey
- key material, up to MAXKEYLENGTH byteslInitCBCIV
- the CBC IV (array with min. BLOCKSIZE bytes)public long getCBCIV()
public void getCBCIV(byte[] dest)
dest
- wher eto put current CBC IV in network byte ordered arraypublic void setCBCIV(long lNewCBCIV)
lNewCBCIV
- the new CBC IVpublic void setCBCIV(byte[] newCBCIV)
newCBCIV
- the new CBC IV in network byte ordered arraypublic void cleanUp()
cleanUp
in class BlowfishECB
public void encrypt(byte[] inbuffer, byte[] outbuffer)
encrypt
in class BlowfishECB
inbuffer
- buffer with plaintext dataoutbuffer
- buffer to get the ciphertext datapublic void encrypt(byte[] buffer)
encrypt
in class BlowfishECB
buffer
- buffer to encryptpublic void encrypt(int[] inbuffer, int[] outbuffer)
encrypt
in class BlowfishECB
inbuffer
- buffer with plaintext dataoutBuffer
- buffer to get the ciphertext datapublic void encrypt(int[] buffer)
encrypt
in class BlowfishECB
buffer
- buffer to encryptpublic void encrypt(long[] inbuffer, long[] outbuffer)
encrypt
in class BlowfishECB
inbuffer
- buffer with plaintext dataoutbuffer
- buffer to get the ciphertext datapublic void encrypt(long[] buffer)
encrypt
in class BlowfishECB
buffer
- buffer to encryptpublic void decrypt(byte[] inbuffer, byte[] outbuffer)
decrypt
in class BlowfishECB
inbuffer
- buffer with ciphertext dataoutBuffer
- buffer to get the plaintext datapublic void decrypt(byte[] buffer)
decrypt
in class BlowfishECB
buffer
- buffer to decryptpublic void decrypt(int[] inbuffer, int[] outbuffer)
decrypt
in class BlowfishECB
inbuffer
- buffer with ciphertext dataoutbuffer
- buffer to get the plaintext datapublic void decrypt(int[] buffer)
decrypt
in class BlowfishECB
buffer
- buffer to decryptpublic void decrypt(long[] inbuffer, long[] outbuffer)
decrypt
in class BlowfishECB
inbuffer
- buffer with ciphertext dataoutbuffer
- buffer to get the plaintext datapublic void decrypt(long[] buffer)
decrypt
in class BlowfishECB
buffer
- buffer to decryptCopyright © 2015 Lucee