org.mapdb
Class EncryptionXTEA
- java.lang.Object
-
- org.mapdb.EncryptionXTEA
-
public final class EncryptionXTEA extends java.lang.ObjectAn 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
Fields Modifier and Type Field and Description static intALIGNBlocks sizes are always multiples of this number.
-
Constructor Summary
Constructors Constructor and Description EncryptionXTEA(byte[] password)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method and Description voiddecrypt(byte[] bytes, int off, int len)voidencrypt(byte[] bytes, int off, int len)static byte[]getHash(byte[] data)Calculate the SHA256 hash code for the given data.
-
-
-
Field Detail
-
ALIGN
public static final int ALIGN
Blocks sizes are always multiples of this number.- See Also:
- Constant Field Values
-
-
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 SHA256 hash code for the given data. Used to hash password.- Parameters:
data- the data to hash- Returns:
- the hash code
-
-
DataMelt 3.0 © DataMelt by jWork.ORG