All Packages Class Hierarchy This Package Previous Next Index
Class iaik.security.cipher.TripleDES
java.lang.Object
|
+----java.security.Cipher
|
+----iaik.security.cipher.TripleDES
- public class TripleDES
- extends Cipher
- implements SymmetricCipher
This class implements the Triple-DES encryption method.
-
TripleDES()
- Constructor for a TripleDES Cipher.
-
engineBlockSize()
- Returns the length of an output block, in bytes.
-
engineInitDecrypt(Key)
- Initializes this cipher for decryption, using the specified key.
-
engineInitEncrypt(Key)
- Initializes this cipher for encryption, using the specified key.
-
engineUpdate(byte[], int, int, byte[], int)
- Add to the bytes to be processed.
TripleDES
public TripleDES()
- Constructor for a TripleDES Cipher. This constructor is only for initializing the superclass.
Applications should not call this constructor to get a TripleDES Cipher; they should call one of
the Cipher.getInstance factory methods instead.
- See Also:
- Cipher
engineInitEncrypt
protected void engineInitEncrypt(Key key) throws InvalidKeyException
- Initializes this cipher for encryption, using the specified key.
The format of the key must be "RAW" and the length must be 16 or 32 bytes.
If the keylength is 16 bytes then TripleDES with 2 keys is used, if the
keylength is 32 TripleDES with 3 keys is used.
- Parameters:
- key - the key to use for encryption
- Throws: InvalidKeyException
- if the key is invalid
- Overrides:
- engineInitEncrypt in class Cipher
engineInitDecrypt
protected void engineInitDecrypt(Key key) throws InvalidKeyException
- Initializes this cipher for decryption, using the specified key.
The format of the key must be "RAW" and the length must be 8 bytes or 64 bits.
- Parameters:
- key - the key to use for encryption
- Throws: InvalidKeyException
- if the key is invalid
- Overrides:
- engineInitDecrypt in class Cipher
engineUpdate
public int engineUpdate(byte in[],
int inOff,
int inLen,
byte out[],
int outOff)
- Add to the bytes to be processed. The result is written to the provided out buffer. The implementation is free to buffer any data,
if the number of bytes passed is insufficient to process a whole block.
- Parameters:
- in - the input data
- inOff - the offset indicating where the subarray starts in the in array
- inLen - the length of the subarray
- out - the output buffer.
- outOff - the offset indicating where to start writing the result into the output buffer
- Returns:
- the number of bytes written to out.
- Throws: IllegalBlockSizeException
- if the length of the input data is not 64 bit
- Overrides:
- engineUpdate in class Cipher
engineBlockSize
protected int engineBlockSize()
- Returns the length of an output block, in bytes.
- Returns:
- the length in bytes of a block for this cipher
- Overrides:
- engineBlockSize in class Cipher
All Packages Class Hierarchy This Package Previous Next Index