Package totalcross.crypto.cipher
Class AESCipher
- java.lang.Object
-
- totalcross.crypto.cipher.Cipher
-
- totalcross.crypto.cipher.AESCipher
-
public class AESCipher extends Cipher
This class implements the AES cryptographic cipher.If you get a
totalcross.crypto.CryptoException: Illegal key size, you must download the strong cryptography files from Oracle site. In order to do that, go to the ReadMe file whole link is below the download link. In this file, search for "Unlimited Strength Java Cryptography Extension" and follow the instructions.
-
-
Field Summary
-
Fields inherited from class totalcross.crypto.cipher.Cipher
chaining, CHAINING_CBC, CHAINING_ECB, CHAINING_NONE, iv, key, nativeHeap, operation, OPERATION_DECRYPT, OPERATION_ENCRYPT, padding, PADDING_NONE, PADDING_PKCS1, PADDING_PKCS5
-
-
Constructor Summary
Constructors Constructor Description AESCipher()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voiddoReset()java.lang.StringgetAlgorithm()Returns the name of the algorithm.intgetBlockLength()Returns the block length.protected booleanisChainingSupported(int chaining)protected booleanisKeySupported(Key key, int operation)protected booleanisPaddingSupported(int padding)protected byte[]process(byte[] data)
-
-
-
Method Detail
-
getAlgorithm
public final java.lang.String getAlgorithm()
Returns the name of the algorithm.- Specified by:
getAlgorithmin classCipher- Returns:
- "AES".
-
getBlockLength
public final int getBlockLength()
Returns the block length.- Specified by:
getBlockLengthin classCipher- Returns:
- Always returns 16.
-
doReset
protected final void doReset() throws NoSuchAlgorithmException, CryptoException- Specified by:
doResetin classCipher- Throws:
NoSuchAlgorithmExceptionCryptoException
-
process
protected final byte[] process(byte[] data) throws CryptoException- Specified by:
processin classCipher- Throws:
CryptoException
-
isKeySupported
protected final boolean isKeySupported(Key key, int operation)
- Specified by:
isKeySupportedin classCipher
-
isChainingSupported
protected final boolean isChainingSupported(int chaining)
- Specified by:
isChainingSupportedin classCipher
-
isPaddingSupported
protected final boolean isPaddingSupported(int padding)
- Specified by:
isPaddingSupportedin classCipher
-
-