All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class is.logi.crypto.keys.TriDESKey

java.lang.Object
   |
   +----is.logi.crypto.Crypto
           |
           +----is.logi.crypto.keys.K
                   |
                   +----is.logi.crypto.keys.SymmetricKey
                           |
                           +----is.logi.crypto.keys.TriDESKey

public class TriDESKey
extends SymmetricKey
implements CipherKey
This is the class for triple-DES keys used in an EDE3 configuration. This is a variant of the standard DES cipher which increases the size of the key-space to make exhaustive key-search infeasible.

The CDS for a triple-DES key is TriDESKey(key) with key a string of 48 hexadecimal digits to create a specific key or TriDESKey(?) for a random TriDESKey object.

Author:
Logi Ragnarsson (logir@hi.is)
See Also:
DESKey

Constructor Index

 o TriDESKey()
Create a new random triple-DES key.
 o TriDESKey(byte[])
Create a new triple-DES key with the key bits from key[0..23].

Method Index

 o cipherBlockSize()
The block-size for the triple-DES cipher is 8 bytes.
 o decrypt(byte[], int, byte[], int)
Decrypt one block of data.
 o encrypt(byte[], int, byte[], int)
Encrypt one block of data.
 o equals(Object)
Return true iff the two keys are equivalent.
 o getAlgorithm()
The name of the algorithm is "DES".
 o getKey()
Return the key-bits for this key as an array of 24 bytes.
 o getSize()
The key-size for the DES cipher is 168 bits.
 o parseCDS(String)
If "TriDESKey( key )" is a valid CDS for a TriDESKey, then TriDESKey.parseCDS(key) will return the described TriDESKey object.
 o plainBlockSize()
The block-size for the triple-DES cipher is 8 bytes.
 o toString()
Return a CDS for this key.

Constructors

 o TriDESKey
 public TriDESKey()
Create a new random triple-DES key.

 o TriDESKey
 public TriDESKey(byte key[])
Create a new triple-DES key with the key bits from key[0..23].

Methods

 o parseCDS
 public static TriDESKey parseCDS(String key) throws InvalidCDSException
If "TriDESKey( key )" is a valid CDS for a TriDESKey, then TriDESKey.parseCDS(key) will return the described TriDESKey object.

A valid CDS can be created by calling the TriDESKey.toString() method.

Throws: InvalidCDSException
if the CDS is malformed.
See Also:
fromString
 o plainBlockSize
 public int plainBlockSize()
The block-size for the triple-DES cipher is 8 bytes.

 o cipherBlockSize
 public int cipherBlockSize()
The block-size for the triple-DES cipher is 8 bytes.

 o getSize
 public int getSize()
The key-size for the DES cipher is 168 bits.

Overrides:
getSize in class K
 o getAlgorithm
 public String getAlgorithm()
The name of the algorithm is "DES".

Overrides:
getAlgorithm in class K
 o equals
 public boolean equals(Object o)
Return true iff the two keys are equivalent.

Overrides:
equals in class Object
 o getKey
 public byte[] getKey()
Return the key-bits for this key as an array of 24 bytes.

 o toString
 public String toString()
Return a CDS for this key.

Overrides:
toString in class Object
See Also:
fromString
 o encrypt
 public void encrypt(byte source[],
                     int i,
                     byte dest[],
                     int j)
Encrypt one block of data. The plain data is taken from source[i..i+23] and ciphertext is written to dest[j..j+23].

 o decrypt
 public void decrypt(byte source[],
                     int i,
                     byte dest[],
                     int j)
Decrypt one block of data. The encrypted data is taken from dest[i..i+23] and plaintext is written to source[j..j+23].


All Packages  Class Hierarchy  This Package  Previous  Next  Index