phelps.crypto

Class RC4

public class RC4 extends Object

RSA's RC4 encryption/decryption. This should inherit from javax.crypto.CipherSpi and be used through javax.crypto.Cipher.getInstance("RC4"). However, it would take some effort to conform to the API, and installation, in order to maintain security, is not automatic. Thus, primarily for convenience of installation, it is provided outside of Java's cryptography architecture.

Version: $Revision: 1.8 $ $Date: 2003/06/01 08:06:17 $

Constructor Summary
RC4(byte[] key)
Method Summary
voiddecrypt(byte[] data)
Convenience method; same as decrypt(data, 0, data.length).
voiddecrypt(byte[] data, int off, int length)
Decrypt data from data, starting at off and extending for length bytes.
voidencrypt(byte[] data)
Convenience method; same as encrypt(data, 0, data.length).
voidencrypt(byte[] data, int off, int length)
Encrypt data from data, starting at off and extending for length bytes.
voidreset()

Constructor Detail

RC4

public RC4(byte[] key)

Method Detail

decrypt

public void decrypt(byte[] data)
Convenience method; same as decrypt(data, 0, data.length).

decrypt

public void decrypt(byte[] data, int off, int length)
Decrypt data from data, starting at off and extending for length bytes. Input data is mutated.

encrypt

public void encrypt(byte[] data)
Convenience method; same as encrypt(data, 0, data.length).

encrypt

public void encrypt(byte[] data, int off, int length)
Encrypt data from data, starting at off and extending for length bytes. In fact RC4 is symmetric so encrypt and decrypt are the same, but separate method names make intentions clearer.

reset

public void reset()