org.mapdb
Class EncryptionXTEA

java.lang.Object
  extended by org.mapdb.EncryptionXTEA

public final class EncryptionXTEA
extends Object

An implementation of the EncryptionXTEA block cipher algorithm.

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

It requires 32 byte long encryption key, so SHA256 password hash is used.


Field Summary
static int ALIGN
          Blocks sizes are always multiples of this number.
 
Constructor Summary
EncryptionXTEA(byte[] password)
           
 
Method Summary
 void decrypt(byte[] bytes, int off, int len)
           
 void encrypt(byte[] bytes, int off, int len)
           
static byte[] getHash(byte[] data)
          Calculate the hash code for the given data.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ALIGN

public static final int ALIGN
Blocks sizes are always multiples of this number.

See Also:
Constant Field Values
Constructor Detail

EncryptionXTEA

public EncryptionXTEA(byte[] password)
Method Detail

encrypt

public void encrypt(byte[] bytes,
                    int off,
                    int len)

decrypt

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

getHash

public static byte[] getHash(byte[] data)
Calculate the hash code for the given data.

Parameters:
data - the data to hash
Returns:
the hash code


Copyright © 2014. All Rights Reserved.