Package org.h2.security
Interface BlockCipher
-
-
Field Summary
Fields Modifier and Type Field Description static intALIGNBlocks sizes are always multiples of this number.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voiddecrypt(byte[] bytes, int off, int len)Decrypt a number of bytes.voidencrypt(byte[] bytes, int off, int len)Encrypt a number of bytes.intgetKeyLength()Get the length of the key in bytes.voidsetKey(byte[] key)Set the encryption key used for encrypting and decrypting.
-
-
-
Field Detail
-
ALIGN
static final int ALIGN
Blocks sizes are always multiples of this number.- See Also:
- Constant Field Values
-
-
Method Detail
-
setKey
void setKey(byte[] key)
Set the encryption key used for encrypting and decrypting. The key needs to be 16 bytes long.- Parameters:
key- the key
-
encrypt
void encrypt(byte[] bytes, int off, int len)Encrypt a number of bytes. This is done in-place, that means the bytes are overwritten.- Parameters:
bytes- the byte arrayoff- the start indexlen- the number of bytes to encrypt
-
decrypt
void decrypt(byte[] bytes, int off, int len)Decrypt a number of bytes. This is done in-place, that means the bytes are overwritten.- Parameters:
bytes- the byte arrayoff- the start indexlen- the number of bytes to decrypt
-
getKeyLength
int getKeyLength()
Get the length of the key in bytes.- Returns:
- the length of the key
-
-