|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.silverpeas.util.crypto.BlowfishCipher
public class BlowfishCipher
Blowfish is a keyed, symmetric block cipher, designed in 1993 by Bruce Schneier and included in a large number of cipher suites and encryption products. Blowfish provides a good encryption rate in software and no effective cryptanalysis of it has been found to date. However, the Advanced Encryption Standard now receives more attention. Blowfish was one of the first secure block ciphers not subject to any patents and therefore freely available for anyone to use. This benefit has contributed to its popularity in cryptographic software. This implementation wraps the Blowfish cipher provided in the Java Cryptography API and it performs the redundant operations in the encryption and in the decryption.
Constructor Summary | |
---|---|
protected |
BlowfishCipher()
|
Method Summary | |
---|---|
String |
decrypt(byte[] cipher,
CipherKey keyCode)
Decrypt the specified code or cipher by using the specified cryptographic key. |
byte[] |
encrypt(String data,
CipherKey keyCode)
Encrypts the specified data by using the specified cryptographic key. |
CipherKey |
generateCipherKey()
Generates randomly a cipher key that can be used in the encryption and in the decryption of data with this cipher. |
CryptographicAlgorithmName |
getAlgorithmName()
Gets the name of the algorithm of the cipher. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
protected BlowfishCipher() throws NoSuchPaddingException, NoSuchAlgorithmException
NoSuchPaddingException
NoSuchAlgorithmException
Method Detail |
---|
public CryptographicAlgorithmName getAlgorithmName()
getAlgorithmName
in interface Cipher
public byte[] encrypt(String data, CipherKey keyCode) throws CryptoException
Cipher
encrypt
in interface Cipher
data
- the data to encode.keyCode
- the key to use in the encryption.
CryptoException
- if an error has occurred in the data encryption.public String decrypt(byte[] cipher, CipherKey keyCode) throws CryptoException
Cipher
decrypt
in interface Cipher
cipher
- the data in bytes encrypted by this cipher.keyCode
- the key to use in the decryption.
CryptoException
- if an error has occurred in the data decryption.public CipherKey generateCipherKey() throws CryptoException
Cipher
generateCipherKey
in interface Cipher
CryptoException
- if an error has occurred in the key generation.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |