public class BlowfishECB extends Object
Modifier and Type | Field and Description |
---|---|
static int |
BLOCKSIZE
block size of this cipher (in bytes)
|
static int |
MAXKEYLENGTH
maximum possible key length
|
Constructor and Description |
---|
BlowfishECB(byte[] bfkey)
default constructor
|
Modifier and Type | Method and Description |
---|---|
void |
cleanUp()
to clear data in the boxes before an instance is freed
|
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 byte buffer (of the same size or bigger)
|
void |
decrypt(int[] buffer)
decrypts an int buffer (should be aligned to an
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 int buffer (should be aligned to a
two integer border)
|
void |
encrypt(int[] inbuffer,
int[] outbuffer)
encrypts an integer 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)
|
static boolean |
selfTest()
selftest routine, to check e.g.
|
public static final int MAXKEYLENGTH
public static final int BLOCKSIZE
public BlowfishECB(byte[] bfkey)
bfkey
- key material, up to MAXKEYLENGTH bytespublic void cleanUp()
public static boolean selfTest()
public void encrypt(byte[] inbuffer, byte[] outbuffer)
inbuffer
- buffer with plaintext dataoutbuffer
- buffer to get the ciphertext datapublic void encrypt(byte[] buffer)
buffer
- buffer to encryptpublic void encrypt(int[] inbuffer, int[] outbuffer)
inbuffer
- buffer with plaintext dataoutBuffer
- buffer to get the ciphertext datapublic void encrypt(int[] buffer)
buffer
- buffer to encryptpublic void encrypt(long[] inbuffer, long[] outbuffer)
inbuffer
- buffer with plaintext dataoutbuffer
- buffer to get the ciphertext datapublic void encrypt(long[] buffer)
buffer
- buffer to encryptpublic void decrypt(byte[] inbuffer, byte[] outbuffer)
inbuffer
- buffer with ciphertext dataoutBuffer
- buffer to get the plaintext datapublic void decrypt(byte[] buffer)
buffer
- buffer to decryptpublic void decrypt(int[] inbuffer, int[] outbuffer)
inbuffer
- buffer with ciphertext dataoutbuffer
- buffer to get the plaintext datapublic void decrypt(int[] buffer)
buffer
- buffer to decryptpublic void decrypt(long[] inbuffer, long[] outbuffer)
inbuffer
- buffer with ciphertext dataoutbuffer
- buffer to get the plaintext datapublic void decrypt(long[] buffer)
buffer
- buffer to decryptCopyright © 2015 Lucee