|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.gregoire.util.crypto.BlowfishECB
org.gregoire.util.crypto.BlowfishCBC
implementation of the Blowfish encryption algorithm in CBC mode
Field Summary |
Fields inherited from class org.gregoire.util.crypto.BlowfishECB |
BLOCKSIZE, MAXKEYLENGTH |
Constructor Summary | |
BlowfishCBC()
constructor, stores a zero CBC IV |
|
BlowfishCBC(byte[] bfkey)
|
|
BlowfishCBC(byte[] bfkey,
byte[] initCBCIV)
constructor |
|
BlowfishCBC(byte[] bfkey,
long lInitCBCIV)
constructor |
Method Summary | |
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) |
Methods inherited from class org.gregoire.util.crypto.BlowfishECB |
decryptBlock, encryptBlock, getBlockSize, getKeySize, initialize, weakKeyCheck |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public BlowfishCBC()
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 bytesMethod Detail |
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 interface BlockCipher
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 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 interface BlockCipher
decrypt
in class BlowfishECB
inbuffer
- buffer with ciphertext 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 decrypt
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |