Package org.apache.shiro.crypto
Class BlowfishCipherService
- java.lang.Object
-
- org.apache.shiro.crypto.JcaCipherService
-
- org.apache.shiro.crypto.AbstractSymmetricCipherService
-
- org.apache.shiro.crypto.DefaultBlockCipherService
-
- org.apache.shiro.crypto.BlowfishCipherService
-
- All Implemented Interfaces:
CipherService
public class BlowfishCipherService extends DefaultBlockCipherService
CipherServiceusing theBlowfishcipher algorithm for all encryption, decryption, and key operations. The Blowfish algorithm can support key sizes between32and448bits*, inclusive. However, modern cryptanalysis techniques render keys of 80 bits or less mostly worthless - use128or more whenever possible. Note that this class retains the parent class's defaultCBCmode of operation instead of the typical JDK default ofECB.ECBshould not be used in security-sensitive environments becauseECBdoes not allow for initialization vectors, which are considered necessary for strong encryption. See theparent class's JavaDoc and theJcaCipherServiceJavaDoc for more on why the JDK default should not be used and is not used in this implementation. * Generating and using Blowfish key sizes greater than 128 require installation of the Java Cryptography Extension (JCE) Unlimited Strength Jurisdiction Policy files.- Since:
- 1.0
-
-
Constructor Summary
Constructors Constructor Description BlowfishCipherService()Creates a newCipherServiceinstance using theBlowfishcipher algorithm with the following important cipher default attributes: Attribute ValuekeySize128bitsblockSize64bits (required forBlowfish)modeCBC*paddingSchemePKCS5initializationVectorSize64bitsgenerateInitializationVectorstrue**
-
Method Summary
-
Methods inherited from class org.apache.shiro.crypto.DefaultBlockCipherService
generateInitializationVector, getBlockSize, getModeName, getPaddingSchemeName, getStreamingBlockSize, getStreamingModeName, getStreamingPaddingSchemeName, getTransformationString, isGenerateInitializationVectors, setBlockSize, setMode, setModeName, setPaddingScheme, setPaddingSchemeName, setStreamingBlockSize, setStreamingMode, setStreamingModeName, setStreamingPaddingScheme, setStreamingPaddingSchemeName
-
Methods inherited from class org.apache.shiro.crypto.AbstractSymmetricCipherService
generateNewKey, generateNewKey
-
Methods inherited from class org.apache.shiro.crypto.JcaCipherService
createParameterSpec, decrypt, decrypt, encrypt, encrypt, ensureSecureRandom, getAlgorithmName, getDefaultSecureRandom, getInitializationVectorSize, getKeySize, getSecureRandom, getStreamingBufferSize, isGenerateInitializationVectors, setGenerateInitializationVectors, setInitializationVectorSize, setKeySize, setSecureRandom, setStreamingBufferSize
-
-
-
-
Constructor Detail
-
BlowfishCipherService
public BlowfishCipherService()
Creates a newCipherServiceinstance using theBlowfishcipher algorithm with the following important cipher default attributes:
* TheAttribute Value keySize128bitsblockSize64bits (required forBlowfish)modeCBC*paddingSchemePKCS5initializationVectorSize64bitsgenerateInitializationVectorstrue**CBCoperation mode is used instead of the JDK defaultECBto ensure strong encryption.ECBshould not be used in security-sensitive environments - see theDefaultBlockCipherServiceclass JavaDoc's "Operation Mode" section for more. **In conjunction with the defaultCBCoperation mode, initialization vectors are generated by default to ensure strong encryption. See theJcaCipherServiceclass JavaDoc for more.
-
-