public class Xtea
extends java.lang.Object
Constructor and Description |
---|
Xtea(byte[] key)
Creates a new instance.
|
Modifier and Type | Method and Description |
---|---|
void |
decrypt(byte[] ciphertext,
byte[] plaintext)
Decrypts a data block.
|
void |
encrypt(byte[] plaintext,
byte[] ciphertext)
Encrypts a data block.
|
public Xtea(byte[] key)
key
- the key to use; must be 16 bytespublic void encrypt(byte[] plaintext, byte[] ciphertext)
plaintext
- the block to encrypt; must be 8 bytesciphertext
- the encrypted block; must be 8 bytespublic void decrypt(byte[] ciphertext, byte[] plaintext)
ciphertext
- the block to decrypt; must be 8 bytesplaintext
- the decrypted block; must be 8 bytes