| cryptix.jce.provider.cipher.BlockCipher cryptix.jce.provider.cipher.CAST5
CAST5 | final public class CAST5 extends BlockCipher (Code) | | CAST5 (a.k.a. CAST-128) in Java, as per RFC 2144.
The author, Carlisle Adams (the CA in CAST, ST standing for Stafford
Tavares) describes CAST5 as:
"...a DES-like Substitution-Permutation Network (SPN) cryptosystem
which appears to have good resistance to differential cryptanalysis,
linear cryptanalysis, and related-key cryptanalysis. This cipher
also possesses a number of other desirable cryptographic properties,
including avalanche, Strict Avalanche Criterion (SAC), Bit
Independence Criterion (BIC), no complementation property, and an
absence of weak and semi-weak keys."
CAST5 is a symmetric block cipher with a block-size of 8 bytes and
a variable key-size of up to 128 bits. Its authors and their employer
(Entrust Technologies, a Nortel majority-owned company) made it available
worldwide on a royalty-free basis for commercial and non-commercial uses.
The CAST5 encryption algorithm has been designed to allow a key size
that can vary from 40 bits to 128 bits, in 8-bit increments (that is, the
allowable key sizes are 40, 48, 56, 64, ..., 112, 120, and 128 bits. For
variable keysize operation, the specification is as follows:
- For key sizes up to and including 80 bits (i.e., 40, 48, 56, 64, 72,
and 80 bits), the algorithm is exactly as specified but uses 12
rounds instead of 16;
- For key sizes greater than 80 bits, the algorithm uses the full 16
rounds;
- For key sizes less than 128 bits, the key is padded with zero bytes
(in the rightmost, or least significant, positions) out to 128 bits
(since the CAST5 key schedule assumes an input key of 128 bits).
References:
version: $Revision: 1.1 $ author: Jeroen C. van Gelderen (gelderen@cryptix.org) author: Raif S. Naffah (raif@cryptix.org) since: Cryptix 2.2.2 |
Constructor Summary | |
public | CAST5() |
Method Summary | |
protected void | coreCrypt(byte[] in, int inOffset, byte[] out, int outOffset) | protected void | coreInit(Key key, boolean decrypt) Initializes this cipher using the specified key. |
coreCrypt | protected void coreCrypt(byte[] in, int inOffset, byte[] out, int outOffset)(Code) | | Encrypt or decrypt a single data block
|
Methods inherited from cryptix.jce.provider.cipher.BlockCipher | final public Object clone() throws CloneNotSupportedException(Code)(Java Doc) abstract void coreCrypt(byte[] in, int inOffset, byte[] out, int outOffset)(Code)(Java Doc) int coreGetBlockSize()(Code)(Java Doc) abstract void coreInit(Key key, boolean decrypt) throws InvalidKeyException(Code)(Java Doc) final protected int engineDoFinal(byte[] input, int inputOffset, int inputLen, byte[] output, int outputOffset) throws ShortBufferException, IllegalBlockSizeException, BadPaddingException(Code)(Java Doc) final protected byte[] engineDoFinal(byte[] input, int inputOffset, int inputLen) throws IllegalBlockSizeException, BadPaddingException(Code)(Java Doc) final protected int engineGetBlockSize()(Code)(Java Doc) final protected byte[] engineGetIV()(Code)(Java Doc) protected int engineGetKeySize(Key key) throws InvalidKeyException(Code)(Java Doc) final protected int engineGetOutputSize(int inputLen)(Code)(Java Doc) final protected AlgorithmParameters engineGetParameters()(Code)(Java Doc) final protected void engineInit(int opmode, Key key, SecureRandom random) throws InvalidKeyException(Code)(Java Doc) final protected void engineInit(int opmode, Key key, AlgorithmParameterSpec params, SecureRandom random) throws InvalidKeyException, InvalidAlgorithmParameterException(Code)(Java Doc) final protected void engineInit(int opmode, Key key, AlgorithmParameters params, SecureRandom random) throws InvalidKeyException, InvalidAlgorithmParameterException(Code)(Java Doc) final protected void engineSetMode(String mode) throws NoSuchAlgorithmException(Code)(Java Doc) final protected void engineSetPadding(String padding) throws NoSuchPaddingException(Code)(Java Doc) final protected int engineUpdate(byte[] input, int inputOffset, int inputLen, byte[] output, int outputOffset) throws ShortBufferException(Code)(Java Doc) final protected byte[] engineUpdate(byte[] input, int inputOffset, int inputLen)(Code)(Java Doc)
|
|
|