public class DESX extends Cipher implements SymmetricCipher
The encoded form of the DESX key should be a 24-byte array, consisting of one 8-byte DES key K and two XOR keys K1 and K2 in order - K, K1 and K2. Encryption and decryption are done as follows:
When DESX is used with the CBC mode class (algorithm name "DESX/CBC"), the result is Outer-CBC, and only one IV is used.
References:
Copyright © 1998
Systemics Ltd on behalf of the
Cryptix Development Team.
All rights reserved.
$Revision: 1.3 $
DECRYPT, ENCRYPT, UNINITIALIZED
Constructor and Description |
---|
DESX()
Constructs a DESX cipher object, in the UNINITIALIZED state.
|
Modifier and Type | Method and Description |
---|---|
int |
engineBlockSize()
SPI: Returns the length of an input block, in bytes.
|
protected void |
engineInitDecrypt(java.security.Key key)
SPI: Initializes this cipher for decryption, using the
specified key.
|
void |
engineInitEncrypt(java.security.Key key)
SPI: Initializes this cipher for encryption, using the
specified key.
|
protected int |
engineUpdate(byte[] in,
int inOffset,
int inLen,
byte[] out,
int outOffset)
SPI: This is the main engine method for updating data.
|
blockSize, clone, crypt, crypt, crypt, doFinal, doFinal, doFinal, doFinal, engineCiphertextBlockSize, engineCrypt, engineGetParameter, engineInBufferSize, engineOutBufferSize, enginePlaintextBlockSize, engineSetPaddingScheme, engineSetParameter, getAlgorithm, getAlgorithms, getAlgorithms, getCiphertextBlockSize, getInputBlockSize, getInstance, getInstance, getInstance, getMode, getOutputBlockSize, getPadding, getPaddingScheme, getParameter, getPlaintextBlockSize, getProvider, getState, inBufferSize, inBufferSizeFinal, initDecrypt, initEncrypt, isPaddingBlockCipher, outBufferSize, outBufferSizeFinal, setParameter, toString, update, update, update, update
public DESX()
public int engineBlockSize()
engineBlockSize
in class Cipher
public void engineInitEncrypt(java.security.Key key) throws java.security.KeyException
engineInitEncrypt
in class Cipher
key
- the key to use for encryption.java.security.KeyException
- if one of the following occurs: protected void engineInitDecrypt(java.security.Key key) throws java.security.KeyException
engineInitDecrypt
in class Cipher
key
- the key to use for decryption.java.security.KeyException
- if one of the following occurs: protected int engineUpdate(byte[] in, int inOffset, int inLen, byte[] out, int outOffset)
in and out may be the same array, and the input and output regions may overlap.
engineUpdate
in class Cipher
in
- the input data.inOffset
- the offset into in specifying where the data starts.inLen
- the length of the subarray.out
- the output array.outOffset
- the offset indicating where to start writing into
the out array.CryptixException
- if the native library is being used, and it
reports an error.