All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class iaik.security.cipher.DES

java.lang.Object
   |
   +----java.security.Cipher
           |
           +----iaik.security.cipher.DES

public class DES
extends Cipher
implements SymmetricCipher
This class implements the DES encryption method.


Constructor Index

 o DES()
Constructor for a DES Cipher.

Method Index

 o des(int[], int[])
The DES function.
 o engineBlockSize()
Returns the length of an output block, in bytes.
 o engineInitDecrypt(Key)
Initializes this cipher for decryption, using the specified key.
 o engineInitEncrypt(Key)
Initializes this cipher for encryption, using the specified key.
 o engineUpdate(byte[], int, int, byte[], int)
Add to the bytes to be processed.

Constructors

 o DES
 public DES()
Constructor for a DES Cipher. This constructor is only for initializing the superclass. Applications should not call this constructor to get a DES Cipher; they should call one of the Cipher.getInstance factory methods instead.

Most of this code is by Dave Zimmerman , and is Copyright (c) 1996 Widget Workshop, Inc. See the source file for details.

See Also:
Cipher

Methods

 o engineInitEncrypt
 protected void engineInitEncrypt(Key key) throws InvalidKeyException
Initializes this cipher for encryption, using the specified key. The format of the key must be "RAW" and the length must be 8 bytes or 64 bits.

Parameters:
key - the key to use for encryption
Throws: InvalidKeyException
if the key is invalid
Overrides:
engineInitEncrypt in class Cipher
 o engineInitDecrypt
 protected void engineInitDecrypt(Key key) throws InvalidKeyException
Initializes this cipher for decryption, using the specified key. The format of the key must be "RAW" and the length must be 8 bytes or 64 bits.

Parameters:
key - the key to use for encryption
Throws: InvalidKeyException
if the key is invalid
Overrides:
engineInitDecrypt in class Cipher
 o engineUpdate
 public int engineUpdate(byte in[],
                         int inOff,
                         int inLen,
                         byte out[],
                         int outOff)
Add to the bytes to be processed. The result is written to the provided out buffer. The implementation is free to buffer any data, if the number of bytes passed is insufficient to process a whole block.

Parameters:
in - the input data
inOff - the offset indicating where the subarray starts in the in array
inLen - the length of the subarray
out - the output buffer.
outOff - the offset indicating where to start writing the result into the output buffer
Returns:
the number of bytes written to out.
Throws: IllegalBlockSizeException
if the length of the input data is not 64 bit
Overrides:
engineUpdate in class Cipher
 o engineBlockSize
 protected int engineBlockSize()
Returns the length of an output block, in bytes.

Returns:
the length in bytes of a block for this cipher
Overrides:
engineBlockSize in class Cipher
 o des
 protected void des(int in[],
                    int out[])
The DES function.


All Packages  Class Hierarchy  This Package  Previous  Next  Index