Top Fields Constructors Methods
org.bouncycastle.crypto.general

pack-priv Class ARC4Engine

extends Object
implements StreamCipher
Class Inheritance
All Implemented Interfaces
org.bouncycastle.crypto.internal.StreamCipher
Imports
org.bouncycastle.crypto.internal.CipherParameters, .DataLengthException, .OutputLengthException, .StreamCipher, org.bouncycastle.crypto.internal.params.KeyParameter

Field Summary

Modifier and TypeField and Description
private byte[]
private static final int
private byte[]
private int
x

private int
y

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public String
getAlgorithmName()

Implements org.bouncycastle.crypto.internal.StreamCipher.getAlgorithmName.

Return the name of the algorithm the cipher implements.
public void
init(boolean
whether or not we are for encryption.
forEncryption
,
CipherParameters
the parameters required to set up the cipher.
params
)

Implements org.bouncycastle.crypto.internal.StreamCipher.init.

initialise a RC4 cipher.
public int
processBytes(byte[]
the input byte array.
in
,
int
the offset into the in array where the data to be processed starts.
inOff
,
int
the number of bytes to be processed.
len
,
byte[]
the output buffer the processed bytes go into.
out
,
int
the offset into the output byte array the processed data starts at.
outOff
)

Implements org.bouncycastle.crypto.internal.StreamCipher.processBytes.

process a block of bytes from in putting the result into out.
public void
public byte
returnByte(byte
the byte to be processed.
in
)

Implements org.bouncycastle.crypto.internal.StreamCipher.returnByte.

encrypt/decrypt a single byte returning the result.
private void
setKey(byte[] keyBytes)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

engineStateback to summary
private byte[] engineState
STATE_LENGTHback to summary
private static final int STATE_LENGTH
workingKeyback to summary
private byte[] workingKey
xback to summary
private int x
yback to summary
private int y

Constructor Detail

ARC4Engineback to summary
pack-priv ARC4Engine()

Method Detail

getAlgorithmNameback to summary
public String getAlgorithmName()

Implements org.bouncycastle.crypto.internal.StreamCipher.getAlgorithmName.

Doc from org.bouncycastle.crypto.internal.StreamCipher.getAlgorithmName.

Return the name of the algorithm the cipher implements.

Returns:String

the name of the algorithm the cipher implements.

initback to summary
public void init(boolean forEncryption, CipherParameters params)

Implements org.bouncycastle.crypto.internal.StreamCipher.init.

initialise a RC4 cipher.

Parameters
forEncryption:boolean

whether or not we are for encryption.

params:CipherParameters

the parameters required to set up the cipher.

Exceptions
IllegalArgumentException:
if the params argument is inappropriate.
processBytesback to summary
public int processBytes(byte[] in, int inOff, int len, byte[] out, int outOff)

Implements org.bouncycastle.crypto.internal.StreamCipher.processBytes.

Doc from org.bouncycastle.crypto.internal.StreamCipher.processBytes.

process a block of bytes from in putting the result into out.

Parameters
in:byte[]

the input byte array.

inOff:int

the offset into the in array where the data to be processed starts.

len:int

the number of bytes to be processed.

out:byte[]

the output buffer the processed bytes go into.

outOff:int

the offset into the output byte array the processed data starts at.

Returns:int

the number of bytes produced - should always be len.

resetback to summary
public void reset()

Implements org.bouncycastle.crypto.internal.StreamCipher.reset.

Doc from org.bouncycastle.crypto.internal.StreamCipher.reset.

reset the cipher. This leaves it in the same state it was at after the last init (if there was one).

returnByteback to summary
public byte returnByte(byte in)

Implements org.bouncycastle.crypto.internal.StreamCipher.returnByte.

Doc from org.bouncycastle.crypto.internal.StreamCipher.returnByte.

encrypt/decrypt a single byte returning the result.

Parameters
in:byte

the byte to be processed.

Returns:byte

the result of processing the input byte.

setKeyback to summary
private void setKey(byte[] keyBytes)