All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class is.hi.logir.cryptonite.DESKey

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

public class DESKey
extends SymmetricKey
implements CipherKey
This is the class for Data Encryption Standard (DES) keys. DES is the most widely used block cipher, although it is nowadays normally used repeatedly for each piece of plain-text and is called triple-DES. This is because the 56-bit key-size of the normal DES is too small to offer complete security.

The CDS for a DES key is DESKey(key) with key a string of 16 hexadecimal digits to create a specific key or DESKey(?) for a random DESKey object.


Constructor Index

 o DESKey()
Create a new random DES key.
 o DESKey(byte[])
Create a new DES key with the key bits from key[0..7].
 o DESKey(long)
Create a new DES key with the key bits from key.
 o DESKey(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 "DES".
 o getKey()
Return the key-bits for this key as an array of 8 bytes.
 o getSize()
Return 56
 o plainBlockSize()
Return 8.
 o toString()
Return a CDS for this key.

Constructors

 o DESKey
 public DESKey()
Create a new random DES key.

 o DESKey
 public DESKey(byte key[])
Create a new DES key with the key bits from key[0..7].

 o DESKey
 public DESKey(long key)
Create a new DES key with the key bits from key.

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

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

Methods

 o plainBlockSize
 public int plainBlockSize()
Return 8.

 o cipherBlockSize
 public int cipherBlockSize()
Return 8.

 o getSize
 public int getSize()
Return 56

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

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 8 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