Top Description Methods
org.bouncycastle.crypto

public Interface StreamCipher

Known Direct Subinterfaces
org.bouncycastle.crypto.modes.CFBModeCipher, org.bouncycastle.crypto.SkippingStreamCipher
Known Direct Implementers
org.bouncycastle.crypto.engines.RC4Engine, org.bouncycastle.crypto.engines.Grain128Engine, org.bouncycastle.crypto.engines.Grainv1Engine, org.bouncycastle.crypto.engines.HC128Engine, org.bouncycastle.crypto.engines.HC256Engine, org.bouncycastle.crypto.engines.ISAACEngine, org.bouncycastle.crypto.engines.VMPCEngine, org.bouncycastle.crypto.engines.Zuc128CoreEngine, org.bouncycastle.crypto.StreamBlockCipher

the interface stream ciphers conform to.

Method Summary

Modifier and TypeMethod and Description
public String

Returns:

the name of the algorithm the cipher implements.
getAlgorithmName
()

Return the name of the algorithm the cipher implements.

public void
init(boolean
if true the cipher is initialised for encryption, if false for decryption.
forEncryption
,
CipherParameters
the key and other data required by the cipher.
params
)

Initialise the cipher.

public int

Returns:

the number of bytes produced - should always be len.
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
)

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

public void
reset()

reset the cipher.

public byte

Returns:

the result of processing the input byte.
returnByte
(byte
the byte to be processed.
in
)

encrypt/decrypt a single byte returning the result.

Method Detail

getAlgorithmNameback to summary
public String 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) throws IllegalArgumentException

Initialise the cipher.

Parameters
forEncryption:boolean

if true the cipher is initialised for encryption, if false for decryption.

params:CipherParameters

the key and other data required by 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) throws DataLengthException

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.

Exceptions
DataLengthException:
if the output buffer is too small.
resetback to summary
public void 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)

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.