All Packages Class Hierarchy This Package Previous Next Index
Class AcmeNet.Util.AcmeCipher
AcmeNet.Util.AcmeCipher
- public class AcmeCipher
A stream cipher for use in Acme's security facilities.
The cipher uses 64-bit keys, represented as longs.
-
AcmeCipher(long)
- Creates a encryption/decryption engine.
-
crypt(byte)
- Encrypt or decrypt one byte of data.
-
crypt(int)
- Encrypt or decrypt one byte of data, presented to this function as an int.
AcmeCipher
public AcmeCipher(long key)
- Creates a encryption/decryption engine.
- Parameters:
- key - the encryption key
crypt
public synchronized byte crypt(byte b)
- Encrypt or decrypt one byte of data.
- Parameters:
- b - a byte to encrypt or decrypt
- Returns:
- the encrypted or decrypted byte
crypt
public synchronized int crypt(int i)
- Encrypt or decrypt one byte of data. This procedure correctly
converts i to a byte, encrypts it, and then correctly
converts the result back to an int in the range 0-255. This
method is designed to work with data produced by the read() method
of InputStream.
- Parameters:
- i - a byte to encrypt or decrypt, encoded as an int
- Returns:
- the encrypted or decrypted byte, converted to an int in the range 0-255
All Packages Class Hierarchy This Package Previous Next Index