Class java.crypt.BlockCipher
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class java.crypt.BlockCipher

java.crypt.BlockCipher

public class BlockCipher
This class is the base for all block ciphers.

The native code BigNum implementation used by the class was developed by, and is owned by Eric Young

Copyright (C) 1995, 1996 Systemics Ltd (http://www.systemics.com/) All rights reserved.


Constructor Index

 o BlockCipher()

Method Index

 o blockDecrypt(byte[], int, byte[], int)
Perform a decryption.
 o blockEncrypt(byte[], int, byte[], int)
Perform an encryption.
 o blockLength()
Return the block length of this cipher.

N.B. the library writer should also implement a public static final int BLOCK_LENGTH for any classes that derive from this one

 o decrypt(byte[])
Decrypt a block of data.
 o decrypt(byte[], byte[])
Decrypt a block of data.
 o decrypt(byte[], int, byte[], int)
Decrypt a block of data.
 o encrypt(byte[])
Encrypt a block of data.
 o encrypt(byte[], byte[])
Encrypt a block of data.
 o encrypt(byte[], int, byte[], int)
Encrypt a block of data.
 o keyLength()
Return the key length for this cipher.

N.B. the library writer should also implement a public static final int KEY_LENGTH for any classes that derive from this one

Constructors

 o BlockCipher
  public BlockCipher()

Methods

 o encrypt
  public final void encrypt(byte text[])
Encrypt a block of data.

N.B. text.length must be block length.

Parameters:
text - the data to be encrypted.
 o decrypt
  public final void decrypt(byte text[])
Decrypt a block of data.

N.B. text.length must be block length.

Parameters:
text - the data to be decrypted.
 o encrypt
  public final void encrypt(byte in[],
                            byte out[])
Encrypt a block of data. The array in is encrypted and returned as array out. Array in and array out can be the same.

N.B. in.length must equal out.length and must also equal block length.

Parameters:
in - the data to be encrypted.
out - the result of the encryption
 o decrypt
  public final void decrypt(byte in[],
                            byte out[])
Decrypt a block of data. The array in is decrypted and returned as array out. Array in and array out can be the same. N.B. in.length must equal out.length and must be a multiple of block length.
Parameters:
in - the data to be decrypted.
out - the result of the decryption.
 o encrypt
  public final void encrypt(byte in[],
                            int in_offset,
                            byte out[],
                            int out_offset)
Encrypt a block of data. The data in is encrypted and returned as data out. The in and out buffers can be the same.
Parameters:
in - the data to be encrypted.
in_offset - the start of data within the in buffer.
out - result of the encryption
out_offset - the start of data within the out buffer.
Throws: ArrayIndexOutOfBoundsException
If the index was invalid.
 o decrypt
  public final void decrypt(byte in[],
                            int in_offset,
                            byte out[],
                            int out_offset)
Decrypt a block of data. The data in is decrypted and returned as data out. The in and out buffers can be the same.
Parameters:
in - the cipher text to be decrypted.
in_offset - the start of data within the in buffer.
out - where the decrypted plain text will be stored.
out_offset - the start of data within the out buffer.
Throws: ArrayIndexOutOfBoundsException
If the index was invalid.
 o blockEncrypt
  protected abstract void blockEncrypt(byte in[],
                                       int in_offset,
                                       byte out[],
                                       int out_offset)
Perform an encryption. The in and out buffers can be the same.
Parameters:
in - The block to be encrypted.
in_offset - The start of data within the in buffer.
out - The result of the encryption.
out_offset - The start of data within the out buffer.
 o blockDecrypt
  protected abstract void blockDecrypt(byte in[],
                                       int in_offset,
                                       byte out[],
                                       int out_offset)
Perform a decryption. The in and out buffers can be the same.
Parameters:
in - The block to be decrypted.
in_offset - The start of data within the in buffer.
out - The result of the decryption.
out_offset - The start of data within the out buffer. stored, this can be the same as in as both will be the same length.
 o blockLength
  public abstract int blockLength()
Return the block length of this cipher.

N.B. the library writer should also implement a public static final int BLOCK_LENGTH for any classes that derive from this one

Returns:
s the block length (in bytes) of this cipher.
 o keyLength
  public abstract int keyLength()
Return the key length for this cipher.

N.B. the library writer should also implement a public static final int KEY_LENGTH for any classes that derive from this one

Returns:
s the key length (in bytes) of this cipher.

All Packages  Class Hierarchy  This Package  Previous  Next  Index