Class au.net.aba.crypto.provider.RC4
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class au.net.aba.crypto.provider.RC4

java.lang.Object
   |
   +----javax.crypto.CipherSpi
           |
           +----au.net.aba.crypto.provider.RC4

public class RC4
extends CipherSpi
A class that provides RC4 stream encryption.

Variable Index

 o ident

Constructor Index

 o RC4()
Construct an empty RC4Crypt.

Method Index

 o cipher(byte)
Encrypt the specified byte and return the encrypted byte.
 o engineDoFinal(byte[], int, int)
Encrypts or decrypts data in a single-part operation, or finishes a multiple-part operation.
 o engineDoFinal(byte[], int, int, byte[], int)
Encrypts or decrypts data in a single-part operation, or finishes a multiple-part operation.
 o engineGetBlockSize()
Returns the block size (in bytes).
 o engineGetIV()
Returns the initialisation vector for this Cipher - in this case null
 o engineGetOutputSize(int)
Returns the length in bytes that an output buffer would need to be in order to hold the result of the next update or doFinal operation, given the input length inputLen (in bytes).
 o engineInit(int, Key, AlgorithmParameterSpec, SecureRandom)
Initialises this cipher with a key and a source of randomness.
 o engineInit(int, Key, SecureRandom)
Initialises this cipher with a key and a source of randomness.
 o engineSetMode(String)
Sets the mode of this cipher.
 o engineSetPadding(String)
Sets the padding mechanism of this cipher.
 o engineUpdate(byte[], int, int)
Continues a multiple-part encryption or decryption operation (depending on how this cipher was initialised), processing another data part.
 o engineUpdate(byte[], int, int, byte[], int)
Continues a multiple-part encryption or decryption operation (depending on how this cipher was initialised), processing another data part.

Variables

 o ident
  public final static String ident

Constructors

 o RC4
  public RC4()
Construct an empty RC4Crypt.

Methods

 o engineInit
  protected void engineInit(int opMode,
                            Key key,
                            SecureRandom rand) throws InvalidKeyException
Initialises this cipher with a key and a source of randomness.
Parameters:
opMode - the cipher mode.
key - the key to be used.
rand - the random number generator to be used.
Throws: InvalidKeyException
if the key is of the wrong type.
Overrides:
engineInit in class CipherSpi
 o engineInit
  protected void engineInit(int opMode,
                            Key key,
                            AlgorithmParameterSpec params,
                            SecureRandom rand) throws InvalidKeyException
Initialises this cipher with a key and a source of randomness.
Parameters:
opMode - the cipher mode.
key - the key to be used.
params - the parameter spec to be used.
rand - the random number generator to be used.
Throws: InvalidKeyException
if the key is of the wrong type.
Overrides:
engineInit in class CipherSpi
 o engineGetIV
  protected byte[] engineGetIV()
Returns the initialisation vector for this Cipher - in this case null
Overrides:
engineGetIV in class CipherSpi
 o engineSetMode
  public void engineSetMode(String mode)
Sets the mode of this cipher.
Overrides:
engineSetMode in class CipherSpi
 o engineSetPadding
  public void engineSetPadding(String padding)
Sets the padding mechanism of this cipher.
Overrides:
engineSetPadding in class CipherSpi
 o engineGetBlockSize
  protected int engineGetBlockSize()
Returns the block size (in bytes).
Returns:
the block size (in bytes), or 0 if the underlying algorithm is not a block cipher
Overrides:
engineGetBlockSize in class CipherSpi
 o engineGetOutputSize
  protected int engineGetOutputSize(int inputLen)
Returns the length in bytes that an output buffer would need to be in order to hold the result of the next update or doFinal operation, given the input length inputLen (in bytes).
Overrides:
engineGetOutputSize in class CipherSpi
 o engineUpdate
  protected byte[] engineUpdate(byte in[],
                                int inOff,
                                int inLen)
Continues a multiple-part encryption or decryption operation (depending on how this cipher was initialised), processing another data part.
Overrides:
engineUpdate in class CipherSpi
 o engineUpdate
  protected int engineUpdate(byte in[],
                             int inOff,
                             int inLen,
                             byte out[],
                             int outOff) throws ShortBufferException
Continues a multiple-part encryption or decryption operation (depending on how this cipher was initialised), processing another data part.
Parameters:
in - the data to be processed.
inOff - the offset in the in array that processing should start from.
inLen - the number of bytes of data to be processed.
out - the array that the output is to be put into.
outOff - the offset in the out array that processed data should start being written at.
Returns:
the number of bytes that were output to the out array.
Throws: ShortBufferException
The provided output buffer is too short.
Overrides:
engineUpdate in class CipherSpi
 o engineDoFinal
  protected byte[] engineDoFinal(byte in[],
                                 int inOff,
                                 int inLen)
Encrypts or decrypts data in a single-part operation, or finishes a multiple-part operation.
Parameters:
in - the data to be processed.
inOff - the offset in the in array that processing should start from.
inLen - the number of bytes of data to be processed.
Returns:
the resulting data (null if there isn't enough).
Overrides:
engineDoFinal in class CipherSpi
 o engineDoFinal
  protected int engineDoFinal(byte in[],
                              int inOff,
                              int inLen,
                              byte out[],
                              int outOff) throws ShortBufferException
Encrypts or decrypts data in a single-part operation, or finishes a multiple-part operation.
Parameters:
in - the data to be processed.
inOff - the offset in the in array that processing should start from.
inLen - the number of bytes of data to be processed.
out - the array that the output is to be put into.
outOff - the offset in the out array that processed data should start being written at.
Returns:
the number of bytes that were output to the out array.
Throws: ShortBufferException
The provided output buffer is too small for the decrypted result.
Overrides:
engineDoFinal in class CipherSpi
 o cipher
  public synchronized byte cipher(byte plainText)
Encrypt the specified byte and return the encrypted byte.
Parameters:
plainText - The plain text data.
Returns:
The encrypted data.

All Packages  Class Hierarchy  This Package  Previous  Next  Index