com.motorola.iden.provider
Class ARC4

java.lang.Object
  |
  +--com.motorola.iden.crypto.CipherSpi
        |
        +--com.motorola.iden.provider.ARC4

public final class ARC4
extends CipherSpi

ARC4, a stream cipher. The key size of ARC4 is less than 256 bits.

MOTOROLA and the Stylized M Logo are registered trademarks of Motorola, Inc. Reg. U.S. Pat. & Tm. Off.
© Copyright 2002 - 2004 Motorola, Inc. All Rights Reserved.

See Also:
[CipherSpi]

Constructor Summary
ARC4()
           
 
Method Summary
protected  byte[] engineDoFinal(byte[] input, int inputOffset, int inputLen)
          Finalizes ARC4 context
protected  int engineGetBlockSize()
          ARC4 is a stream cipher.
protected  byte[] engineGetIV()
          ARC4 does not use IV.
protected  void engineInit()
          Inits security builder by using the members of DES instance.
protected  void engineInit(int opmode, Key key, AlgorithmParameterSpec params, SecureRandom random)
          init ARC4 context.
protected  void engineSetMode(java.lang.String mode)
          engineSetMode is not implemented
protected  void engineSetPadding(java.lang.String padding)
          engineSetadding is not implemented
protected  byte[] engineUpdate(byte[] input, int inputOffset, int inputLen)
          update ARC4 context.
protected  void finalize()
           
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ARC4

public ARC4()
Method Detail

engineSetMode

protected void engineSetMode(java.lang.String mode)
                      throws NoSuchAlgorithmException
engineSetMode is not implemented
Overrides:
engineSetMode in class CipherSpi
Following copied from class: com.motorola.iden.crypto.CipherSpi
Parameters:
mode - the cipher mode
Throws:
NoSuchAlgorithmException - if the requested cipher mode does not exist

engineSetPadding

protected void engineSetPadding(java.lang.String padding)
                         throws NoSuchPaddingException
engineSetadding is not implemented
Overrides:
engineSetPadding in class CipherSpi
Following copied from class: com.motorola.iden.crypto.CipherSpi
Parameters:
padding - the padding mechanism
Throws:
NoSuchPaddingException - if the requested padding mechanism does not exist

engineGetBlockSize

protected int engineGetBlockSize()
ARC4 is a stream cipher. The mothod returns zero.
Overrides:
engineGetBlockSize in class CipherSpi
Following copied from class: com.motorola.iden.crypto.CipherSpi
Returns:
the block size (in bytes), or 0 if the underlying algorithm is not a block cipher

engineGetIV

protected byte[] engineGetIV()
ARC4 does not use IV.
Overrides:
engineGetIV in class CipherSpi
Throws:
SecurityException:ARC4 - does not use IV

engineInit

protected void engineInit(int opmode,
                          Key key,
                          AlgorithmParameterSpec params,
                          SecureRandom random)
                   throws InvalidKeyException,
                          InvalidAlgorithmParameterException
init ARC4 context.
Overrides:
engineInit in class CipherSpi
Parameters:
opmode,key,ivparmeters - and random.
Returns:
void.

engineUpdate

protected byte[] engineUpdate(byte[] input,
                              int inputOffset,
                              int inputLen)
update ARC4 context.
Overrides:
engineUpdate in class CipherSpi
Parameters:
input, - inputoffset, inputLen
Returns:
encrypted or decrypted message.

engineDoFinal

protected byte[] engineDoFinal(byte[] input,
                               int inputOffset,
                               int inputLen)
                        throws IllegalBlockSizeException,
                               BadPaddingException
Finalizes ARC4 context
Overrides:
engineDoFinal in class CipherSpi
Parameters:
input, - inputoffset, inputLen
Returns:
encrypted or decrypted message.

finalize

protected void finalize()
Overrides:
finalize in class java.lang.Object

engineInit

protected void engineInit()
                   throws InvalidKeyException,
                          InvalidAlgorithmParameterException
Inits security builder by using the members of DES instance.