org.mapdb
Class EncryptionXTEA
java.lang.Object
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. |
|
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 |
ALIGN
public static final int ALIGN
- Blocks sizes are always multiples of this number.
- See Also:
- Constant Field Values
EncryptionXTEA
public EncryptionXTEA(byte[] password)
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.