anon.crypto
Class AesDecryption

java.lang.Object
  extended by anon.crypto.AesDecryption

public class AesDecryption
extends java.lang.Object

This class is a wrapper for doing AES decryption stuff.


Field Summary
private  org.bouncycastle.crypto.engines.AESFastEngine m_decryptionInstance
          Stores the used AES decryption algorithm.
 
Constructor Summary
AesDecryption(byte[] a_aesKey)
          Creates a new instance of AesDecryption.
 
Method Summary
 byte[] decrypt(byte[] a_cipherData)
          Decrypts one single cipher data block and returns the plain data block.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_decryptionInstance

private org.bouncycastle.crypto.engines.AESFastEngine m_decryptionInstance
Stores the used AES decryption algorithm.

Constructor Detail

AesDecryption

public AesDecryption(byte[] a_aesKey)
              throws java.lang.Exception
Creates a new instance of AesDecryption. The size of the key must be 16 bytes (128 bit), 24 bytes (192 bit) or 32 bytes (256 bit). If the key size doesn't fit, an exception is thrown.

Parameters:
a_aesKey - The 128 bit or 192 bit or 256 bit AES key.
Throws:
java.lang.Exception
Method Detail

decrypt

public byte[] decrypt(byte[] a_cipherData)
               throws java.lang.Exception
Decrypts one single cipher data block and returns the plain data block. The blocksize is always 16 bytes (128 bit). If the cipher data block is shorter than 16 bytes, an exception is thrown, if it is longer, only the first 16 bytes are decrypted and returned in the plain block.

Parameters:
a_cipherData - The cipher data block.
Returns:
The plain data block. The length is always 16 bytes.
Throws:
java.lang.Exception