Class java.crypt.StreamCipher
All Packages Class Hierarchy This Package Previous Next Index
Class java.crypt.StreamCipher
java.crypt.StreamCipher
- public class StreamCipher
This abstract class is the basis for a stream cipher of any form.
N.B. Even though there is no constructor, there is a key length
method so that the user can find the key length. There is no key in the base
class because the key storage varies with cipher type, and is left to
the designer of the derived class.
Copyright (C) 1995, 1996 Systemics Ltd (http://www.systemics.com/)
All rights reserved.
-
StreamCipher()
-
-
decrypt(byte[])
- This function decrypts a block of data.
-
decrypt(byte[], byte[])
- This function decrypts a block of data.
-
decrypt(byte[], int, byte[], int, int)
- This function decrypts a block of data.
-
encrypt(byte[])
- This function encrypts a block of data.
-
encrypt(byte[], byte[])
- This function encrypts a block of data.
-
encrypt(byte[], int, byte[], int, int)
- This function encrypts a block of data.
-
keyLength()
- This function returns the length of the key for this cipher.
N.B. The library writer should also implement a
public static final int KEY_LENGTH for any classes that derive from
this.
StreamCipher
public StreamCipher()
encrypt
public final void encrypt(byte text[])
- This function encrypts a block of data.
The contents of the array will be changed.
- Parameters:
- text - The plaintext to be encrypted.
decrypt
public final void decrypt(byte text[])
- This function decrypts a block of data.
The contents of the array will be changed.
- Parameters:
- text - The ciphertext to be decrypted.
encrypt
public final void encrypt(byte in[],
byte out[])
- This function encrypts a block of data.
The contents of the array in remain unchanged,
and the result is stored in the array out.
However, array in and array out can be the same.
- Parameters:
- in - The plaintext to be encrypted.
- out - Where the ciphertext will be stored.
decrypt
public final void decrypt(byte in[],
byte out[])
- This function decrypts a block of data.
The contents of the array in remain unchanged,
and the result is stored in the array out.
However, array in and array out can be the same.
- Parameters:
- in - The ciphertext to be decrypted.
- out - Where the plaintext will be stored.
encrypt
public abstract void encrypt(byte in[],
int in_offset,
byte out[],
int out_offset,
int length)
- This function encrypts a block of data.
The contents of the array in remain unchanged,
and the result is stored in the array out.
However, array in and array out can be the same.
- Parameters:
- in - The plaintext to be encrypted.
- in_offset - The start of data within the in buffer.
- out - Where the ciphertext will be stored.
- off_offset - The start of data within the out buffer.
- length - The length to encrypt.
decrypt
public abstract void decrypt(byte in[],
int in_offset,
byte out[],
int out_offset,
int length)
- This function decrypts a block of data.
The contents of the array in remain unchanged,
and the result is stored in the array out.
However, array in and array out can be the same.
- Parameters:
- in - The ciphertext to be decrypted.
- in_offset - The start of data within the in buffer.
- out - Where the plaintext will be stored.
- off_offset - The start of data within the out buffer.
- length - The length to decrypt.
keyLength
public abstract int keyLength()
- This function returns the length of the key for this cipher.
N.B. The library writer should also implement a
public static final int KEY_LENGTH for any classes that derive from
this.
- Returns:
- s the length (in bytes) of the key used with this cipher
All Packages Class Hierarchy This Package Previous Next Index