PulpCore

pulpcore.util.crypt
Class ARC4

java.lang.Object
  extended by pulpcore.util.crypt.ARC4

public class ARC4
extends Object

An unofficial implementation of the ARC4 cipher algorithm.


Constructor Summary
ARC4()
          Constructs a new ARC4 object with a randomly generated encryption key.
ARC4(byte[] key)
          Constructs a new ARC4 object with the specified encryption key.
 
Method Summary
 void crypt(byte[] data)
          Crypts the data.
 void crypt(byte[] input, byte[] output)
          Crypts the data from the input array to the output array.
 void reset()
          Resets the cipher to start encrypting a new stream of data.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ARC4

public ARC4()
Constructs a new ARC4 object with a randomly generated encryption key.


ARC4

public ARC4(byte[] key)
Constructs a new ARC4 object with the specified encryption key. The key can be at most 256 bytes in length.

Parameters:
key - the encryption key.
Method Detail

reset

public void reset()
Resets the cipher to start encrypting a new stream of data.


crypt

public void crypt(byte[] data)
Crypts the data.

Parameters:
data - The data to crpyt.

crypt

public void crypt(byte[] input,
                  byte[] output)
Crypts the data from the input array to the output array.

Parameters:
input - The source data.
output - The array to store the crpyted data, which must be as long as the input data.

PulpCore

Copyright © 2007-2009 Interactive Pulp, LLC.