Top Description Fields Constructors Methods
org.h2.security

public Class XTEA

extends Object
implements BlockCipher
Class Inheritance
All Implemented Interfaces
org.h2.security.BlockCipher
Static Imports
org.h2.util.Bits.INT_VH_BE

An implementation of the XTEA block cipher algorithm.

This implementation uses 32 rounds. The best attack reported as of 2009 is 36 rounds (Wikipedia).

Field Summary

Modifier and TypeField and Description
private static final int
private int
private int
private int
private int
private int
private int
private int
private int
private int
private int
private int
private int
private int
private int
private int
private int
private int
private int
private int
private int
private int
private int
private int
private int
private int
private int
private int
private int
private int
private int
private int
private int

Constructor Summary

AccessConstructor and Description
public
XTEA()

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
)

Implements org.h2.security.BlockCipher.decrypt.

Decrypt a number of bytes.

private void
decryptBlock(byte[] in, byte[] out, int off)

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

Implements org.h2.security.BlockCipher.encrypt.

Encrypt a number of bytes.

private void
encryptBlock(byte[] in, byte[] out, int off)

public int
getKeyLength()

Implements org.h2.security.BlockCipher.getKeyLength.

Get the length of the key in bytes.

public void
setKey(byte[]
the key
b
)

Implements org.h2.security.BlockCipher.setKey.

Set the encryption key used for encrypting and decrypting.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

DELTAback to summary
private static final int DELTA
k0back to summary
private int k0
k1back to summary
private int k1
k10back to summary
private int k10
k11back to summary
private int k11
k12back to summary
private int k12
k13back to summary
private int k13
k14back to summary
private int k14
k15back to summary
private int k15
k16back to summary
private int k16
k17back to summary
private int k17
k18back to summary
private int k18
k19back to summary
private int k19
k2back to summary
private int k2
k20back to summary
private int k20
k21back to summary
private int k21
k22back to summary
private int k22
k23back to summary
private int k23
k24back to summary
private int k24
k25back to summary
private int k25
k26back to summary
private int k26
k27back to summary
private int k27
k28back to summary
private int k28
k29back to summary
private int k29
k3back to summary
private int k3
k30back to summary
private int k30
k31back to summary
private int k31
k4back to summary
private int k4
k5back to summary
private int k5
k6back to summary
private int k6
k7back to summary
private int k7
k8back to summary
private int k8
k9back to summary
private int k9

Constructor Detail

XTEAback to summary
public XTEA()

Method Detail

decryptback to summary
public void decrypt(byte[] bytes, int off, int len)

Implements org.h2.security.BlockCipher.decrypt.

Doc from org.h2.security.BlockCipher.decrypt.

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

Annotations
@Override
decryptBlockback to summary
private void decryptBlock(byte[] in, byte[] out, int off)
encryptback to summary
public void encrypt(byte[] bytes, int off, int len)

Implements org.h2.security.BlockCipher.encrypt.

Doc from org.h2.security.BlockCipher.encrypt.

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

Annotations
@Override
encryptBlockback to summary
private void encryptBlock(byte[] in, byte[] out, int off)
getKeyLengthback to summary
public int getKeyLength()

Implements org.h2.security.BlockCipher.getKeyLength.

Doc from org.h2.security.BlockCipher.getKeyLength.

Get the length of the key in bytes.

Returns:int

the length of the key

Annotations
@Override
setKeyback to summary
public void setKey(byte[] b)

Implements org.h2.security.BlockCipher.setKey.

Doc from org.h2.security.BlockCipher.setKey.

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

Parameters
b:byte[]

the key

Annotations
@Override