|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectj_waste.crypto.Blowfish
This class handles the Blowfish encryption and decryption.
| Constructor Summary | |
Blowfish(byte[] sessionKey,
byte[] ivEnc,
byte[] ivDec,
java.lang.String mode)
Constructs a new Blowfish object. |
|
| Method Summary | |
byte[] |
decrypt(byte[] input)
This method decrypts the specified array with the initialized session key and iv. |
byte[] |
decryptWPCBC(byte[] input)
This method decryts the input array the same way as the PCBC decryption in waste. |
byte[] |
encrypt(byte[] input)
This method encrypts the specified array with the initialized session key and iv. |
byte[] |
encryptWPCBC(byte[] input)
This method encryts the input array the same way as the PCBC encryption in waste. |
byte[] |
generateKey(int keySize)
This method generates a key with the specified key size. |
static void |
main(java.lang.String[] argv)
This method will pad out the input array to a multiple of the Blowfish block size. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public Blowfish(byte[] sessionKey,
byte[] ivEnc,
byte[] ivDec,
java.lang.String mode)
sessionKey - The session key to be used.ivEnc - The initialization vector for encryption.ivDec - The initialization vector for decryption.mode - The mode of encryption. (i.e. CBC, PCBC, ECB, WPCBC (WPCBC is compatible with the errorenous PCBC mode in waste.))| Method Detail |
public byte[] encrypt(byte[] input)
throws javax.crypto.IllegalBlockSizeException,
javax.crypto.BadPaddingException
input - The input array that will be encrypted.
javax.crypto.IllegalBlockSizeException
javax.crypto.BadPaddingException
public byte[] decrypt(byte[] input)
throws javax.crypto.IllegalBlockSizeException,
javax.crypto.BadPaddingException
input - The input array that will be decrypted.
javax.crypto.IllegalBlockSizeException
javax.crypto.BadPaddingExceptionpublic byte[] generateKey(int keySize)
keySize - The size of the key to be generated.
public byte[] encryptWPCBC(byte[] input)
input - the data to be encrypted. Must me a multiple of 8 bytes.public byte[] decryptWPCBC(byte[] input)
input - the data to be encrypted. Must me a multiple of 8 bytes.public static void main(java.lang.String[] argv)
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||