cryptix.provider.cipher
Class DES2X
- Parameterized, SymmetricCipher
This class implements DES2X encryption with four independent
keys. DES2X acts as a block cipher with an 8 byte block size.
The encoded form of the DESX key should be a 32-byte array,
consisting of one 8-byte DES key K and three XOR keys K1, K2 and K3
in order - K, K1, K2 and K3.
Encryption and decryption are done as follows:
- C = E(E(P XOR K1) XOR K2) XOR K3
- P = D(D(C XOR K3) XOR K2) XOR K1
When DES2X is used with the CBC mode class (algorithm name
"DES2X/CBC"), the result is Outer-CBC, and only one IV is used.
References:
- Bruce Schneier,
"Chapter 12 Data Encryption Standard," and
"Section 15.2 Triple Encryption,"
Applied Cryptography, 2nd edition,
John Wiley & Sons, 1996
- R.C. Merkle and M. Hellman,
"On the Security of Multiple Encryption,"
Communications of the ACM,
vol. 24 no. 7, 1981, pages 465-467.
- P Karn, P Metzger, W A Simpson
"The ESP Triple DES Transform,"
Internet Draft,
draft-simpson-esp-des3-x-01.txt
Copyright © 1998
Systemics Ltd on behalf of the
Cryptix Development Team.
All rights reserved.
$Revision: 1.3 $
DES2X()- Constructs a DES2X cipher object, in the UNINITIALIZED state.
|
int | engineBlockSize()- SPI: Returns the length of an input block, in bytes.
|
protected void | engineInitDecrypt(Key key)- SPI: Initializes this cipher for decryption, using the
specified key.
|
void | engineInitEncrypt(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, engineBlockSize, engineCiphertextBlockSize, engineCrypt, engineGetParameter, engineInBufferSize, engineInitDecrypt, engineInitEncrypt, engineOutBufferSize, enginePlaintextBlockSize, engineSetPaddingScheme, engineSetParameter, engineUpdate, 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 |
DES2X
public DES2X()
Constructs a DES2X cipher object, in the UNINITIALIZED state.
This calls the Cipher constructor with implBuffering false,
implPadding false and the provider set to "Cryptix".
engineBlockSize
public int engineBlockSize()
SPI: Returns the length of an input block, in bytes.
- engineBlockSize in interface Cipher
- the length in bytes of an input block for this cipher.
engineInitDecrypt
protected void engineInitDecrypt(Key key)
throws KeyException SPI: Initializes this cipher for decryption, using the
specified key.
- engineInitDecrypt in interface Cipher
key - the key to use for decryption.
engineInitEncrypt
public void engineInitEncrypt(Key key)
throws KeyException SPI: Initializes this cipher for encryption, using the
specified key.
- engineInitEncrypt in interface Cipher
key - the key to use for encryption.
engineUpdate
protected int engineUpdate(byte[] in,
int inOffset,
int inLen,
byte[] out,
int outOffset) SPI: This is the main engine method for updating data.
in and
out may be the same array, and the input and output
regions may overlap.
- engineUpdate in interface 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.
- the number of bytes written.