JXTA

jxta.security.impl.cipher
Class RC4Cipher

java.lang.Object
  |
  +--jxta.security.impl.cipher.RC4Cipher

public final class RC4Cipher
extends java.lang.Object
implements jxta.security.cipher.Cipher

This class implements the RC4 stream cipher


Fields inherited from interface jxta.security.cipher.Cipher
ALG_RC4, Ciper, MODE_DECRYPT, MODE_ENCRYPT, MODE_UNKNOWN
 
Constructor Summary
RC4Cipher()
          Constructor
 
Method Summary
 void clearDebug()
          turn off debugging
 int doFinal(byte[] inBuf, int inOff, int inLen, byte[] outBuf, int outOff)
          Call here if you only have one buffer, or its the last buffer.
 byte getAlgorithm()
          accessor for algorithm
 java.lang.String getAlgorithmName()
           
 void init(jxta.security.cipher.Key theKey, byte theMode)
           
 void init(jxta.security.cipher.Key theKey, byte theMode, byte[] b, int off, int len)
          Initialize key.
 void setDebug()
          turn on debugging
 int transform(byte[] inBuf, int inOff, int inLen, byte[] outBuf, int outOff)
          Encrypt or decrypt the inBuf, storing results in outBuff paying attention to offsets.
 int update(byte[] inBuf, int inOff, int inLen, byte[] outBuf, int outOff)
          Call update only if one has multiple buffers to encrypt/decrypt
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RC4Cipher

public RC4Cipher()
Constructor
Method Detail

getAlgorithmName

public java.lang.String getAlgorithmName()

setDebug

public void setDebug()
turn on debugging

clearDebug

public void clearDebug()
turn off debugging

getAlgorithm

public byte getAlgorithm()
accessor for algorithm
Specified by:
getAlgorithm in interface jxta.security.cipher.Cipher

init

public void init(jxta.security.cipher.Key theKey,
                 byte theMode,
                 byte[] b,
                 int off,
                 int len)
          throws jxta.security.exceptions.CryptoException
Initialize key. RC4 does not require extra parameters.
Specified by:
init in interface jxta.security.cipher.Cipher

init

public void init(jxta.security.cipher.Key theKey,
                 byte theMode)
          throws jxta.security.exceptions.CryptoException
Specified by:
init in interface jxta.security.cipher.Cipher

transform

public int transform(byte[] inBuf,
                     int inOff,
                     int inLen,
                     byte[] outBuf,
                     int outOff)
Encrypt or decrypt the inBuf, storing results in outBuff paying attention to offsets.

update

public int update(byte[] inBuf,
                  int inOff,
                  int inLen,
                  byte[] outBuf,
                  int outOff)
           throws jxta.security.exceptions.CryptoException
Call update only if one has multiple buffers to encrypt/decrypt
Specified by:
update in interface jxta.security.cipher.Cipher

doFinal

public int doFinal(byte[] inBuf,
                   int inOff,
                   int inLen,
                   byte[] outBuf,
                   int outOff)
            throws jxta.security.exceptions.CryptoException
Call here if you only have one buffer, or its the last buffer.
Specified by:
doFinal in interface jxta.security.cipher.Cipher

JXTA