Top Description Fields Methods
org.h2.security

public Interface BlockCipher

Known Direct Implementers
org.h2.security.Fog, org.h2.security.XTEA, org.h2.security.AES

A block cipher is a data encryption algorithm that operates on blocks.

Field Summary

Modifier and TypeField and Description
public static final int
ALIGN

Blocks sizes are always multiples of this number.

Method Summary

Modifier and TypeMethod and Description
public void
decrypt(byte[]
the byte array
bytes
,
int
the start index
off
,
int
the number of bytes to decrypt
len
)

Decrypt a number of bytes.

public void
encrypt(byte[]
the byte array
bytes
,
int
the start index
off
,
int
the number of bytes to encrypt
len
)

Encrypt a number of bytes.

public int

Returns:

the length of the key
getKeyLength
()

Get the length of the key in bytes.

public void
setKey(byte[]
the key
key
)

Set the encryption key used for encrypting and decrypting.

Field Detail

ALIGNback to summary
public static final int ALIGN

Blocks sizes are always multiples of this number.

Method Detail

decryptback to summary
public 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:byte[]

the byte array

off:int

the start index

len:int

the number of bytes to decrypt

encryptback to summary
public 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:byte[]

the byte array

off:int

the start index

len:int

the number of bytes to encrypt

getKeyLengthback to summary
public int getKeyLength()

Get the length of the key in bytes.

Returns:int

the length of the key

setKeyback to summary
public void setKey(byte[] key)

Set the encryption key used for encrypting and decrypting. The key needs to be 16 bytes long.

Parameters
key:byte[]

the key