All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class Acme.Crypto.Rc4Cipher

java.lang.Object
   |
   +----Acme.Crypto.CryptoUtils
           |
           +----Acme.Crypto.Cipher
                   |
                   +----Acme.Crypto.StreamCipher
                           |
                           +----Acme.Crypto.Rc4Cipher

public class Rc4Cipher
extends StreamCipher
The RC4 encryption method.

This may or may not be the real RC4 cipher. It's based on code which showed up anonymously posted in sci.crypt. Here's the start of the article:

 Path: dog.ee.lbl.gov!overload.lbl.gov!lll-winken.llnl.gov!seismo!rsg1.er.usgs.gov!jobone!newsxfer.itd.umich.edu!europa.eng.gtefsd.com!howland.reston.ans.net!EU.net!sun4nl!hacktic!usenet
 From: nobody@vox.xs4all.nl (An0nYm0Us UsEr)
 Newsgroups: sci.crypt
 Subject: RC4 ?
 Date: 13 Sep 1994 21:30:36 GMT
 Organization: Global Anonymous Remail Services Ltd.
 Lines: 83
 Message-ID: <3555ls$fsv@news.xs4all.nl>
 NNTP-Posting-Host: xs1.xs4all.nl
 X-Comment: This message did not originate from the above address.
 X-Comment: It was automatically remailed by an anonymous mailservice.
 X-Comment: Info: usura@xs4all.nl, Subject: remailer-help 
 X-Comment: Please report inappropriate use to <admin@vox.xs4all.nl>
 SUBJECT:  RC4 Source Code
 I've tested this.  It is compatible with the RC4 object module
 that comes in the various RSA toolkits.  
 

It's surprisingly fast, for pure Java. On a SPARC 20, wrapped in Acme.Crypto.EncryptedOutputStream or Acme.Crypto.EncryptedInputStream, it does around 13000 bytes/second.

Fetch the software.
Fetch the entire Acme package.

See Also:
EncryptedOutputStream, EncryptedInputStream

Constructor Index

 o Rc4Cipher(byte[])
 o Rc4Cipher(String)

Method Index

 o decrypt(byte)
Decrypt a byte.
 o decrypt(byte[], int, byte[], int, int)
Decrypt some bytes.
 o encrypt(byte)
Encrypt a byte.
 o encrypt(byte[], int, byte[], int, int)
Encrypt some bytes.
 o setKey(byte[])
Set the key.

Constructors

 o Rc4Cipher
 public Rc4Cipher(String keyStr)
 o Rc4Cipher
 public Rc4Cipher(byte key[])

Methods

 o setKey
 public void setKey(byte key[])
Set the key.

Overrides:
setKey in class Cipher
 o encrypt
 public byte encrypt(byte clearText)
Encrypt a byte.

Overrides:
encrypt in class StreamCipher
 o decrypt
 public byte decrypt(byte cipherText)
Decrypt a byte.

Overrides:
decrypt in class StreamCipher
 o encrypt
 public void encrypt(byte clearText[],
                     int clearOff,
                     byte cipherText[],
                     int cipherOff,
                     int len)
Encrypt some bytes.

Overrides:
encrypt in class StreamCipher
 o decrypt
 public void decrypt(byte cipherText[],
                     int cipherOff,
                     byte clearText[],
                     int clearOff,
                     int len)
Decrypt some bytes.

Overrides:
decrypt in class StreamCipher

All Packages  Class Hierarchy  This Package  Previous  Next  Index

ACME Java  ACME Labs