All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class is.hi.logir.cryptonite.TriDESKey

java.lang.Object
   |
   +----is.hi.logir.cryptonite.Cryptonite
           |
           +----is.hi.logir.cryptonite.K
                   |
                   +----is.hi.logir.cryptonite.SymmetricKey
                           |
                           +----is.hi.logir.cryptonite.TriDESKey

public class TriDESKey
extends SymmetricKey
implements CipherKey
This is the class for Triple-DES keys.

The CDS for a triple-DES key is TriDESKey(key) to create a specific key or TriDESKey(?) for a random TriDESKey object.


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].
 o TriDESKey(String)
Called by Cryptonite.fromString(String) .

Method Index

 o cipherBlockSize()
Return 8.
 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 this is equivalent to k.
 o getAlgorithm()
Return "TriDES".
 o getKey()
Return the key-bits for this key as an array of 24 bytes.
 o getSize()
Return 168
 o plainBlockSize()
Return 8.
 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].

 o TriDESKey
 public TriDESKey(String key) throws InvalidCDSException
Called by Cryptonite.fromString(String) .

Throws: InvalidCDSException
if the CDS is in some way malformed.
See Also:
fromString

Methods

 o plainBlockSize
 public int plainBlockSize()
Return 8.

 o cipherBlockSize
 public int cipherBlockSize()
Return 8.

 o getSize
 public int getSize()
Return 168

Overrides:
getSize in class K
 o getAlgorithm
 public String getAlgorithm()
Return "TriDES".

Overrides:
getAlgorithm in class K
 o equals
 public boolean equals(Object o)
Return true iff this is equivalent to k.

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+7] and ciphertext is written to dest[j..j+7].

 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+7] and plaintext is written to source[j..j+7].


All Packages  Class Hierarchy  This Package  Previous  Next  Index