public final class Cast128Cipher extends SymmetricBlockCipher
CAST128 is a symmetric block cipher that can process data blocks of 64 bits, with cipher keys of lengths 40, 48, 56, 64, 72, 80, 88, 96, 104, 112, 120, and 128 bits. This algorithm is most commonly used with keys of 40, 64, 80, and 128 bits in length.
An instance of this algorithm can be obtained using the Java Cryptography
Architecture (JCA), by requesting a 'CAST128' cipher from the
Entrust cryptographic
service provider. This can be done using either of the following calls:
Cipher.getInstance("CAST128", "Entrust");Cipher.getInstance("CAST128/<mode>/<padding>", "Entrust");
A default block mode (mechanism) and padding mechanism are automatically used
when either block mechanism or padding mechanism are not specified in the
Cipher.getInstance() call. For a description of Entrust's
symmetric block cipher architecture, including supported block mechanisms,
padding mechanisms, and their default values, please refer to
SymmetricBlockCipher.
This cipher implementation only accepts keys in 'RAW' format (software keys).
A CAST128 key can be generated using the CAST128 key generation algorithm (KeyGenerator.getInstance("CAST128, "Entrust")
) or manually created using an appropriate Key implementation (
javax.crypto.spec.SecretKeySpec).
This cipher implementation only requires parameters when operated in a mode
that requires an initialization vector (IV). In this case, the only algorithm
parameters in transparent representation that are accepted are
javax.crypto.spec.IvParameterSpec and
CAST128ParameterSpec. Algorithm parameters in
opaque representation are also accepted (AlgorithmParameters.getInstance("CAST128, "Entrust"), AlgorithmParameters.getInstance("IV, "Entrust")), but these will need
to be initialized with a transparent representation before they can be used
by the cipher.
This class SHOULD NOT be used directly; it should only be used through the JCA/JCE.
| Constructor and Description |
|---|
Cast128Cipher()
The constructor; creates a new instance of the CAST128 (aka: CAST5)
symmetric cipher algorithm.
|
engineDoFinal, engineDoFinal, engineGetBlockSize, engineGetIV, engineGetKeySize, engineGetOutputSize, engineGetParameters, engineInit, engineInit, engineInit, engineSetMode, engineSetPadding, engineUnwrap, engineUpdate, engineUpdate, engineUpdateAAD, engineWrappublic Cast128Cipher()
Applications should never use this constructor, instead the symmetric
cipher algorithm should be requested from the appropriate JCA/JCE
cryptographic service provider as follows:
Cipher.getInstance("CAST128", "Entrust").