Class AES

  • All Implemented Interfaces:

    
    public class AES
    
                        

    Encryption and decryption using AES.

    Author:

    Daniel Andrade

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Constructor Summary

      Constructors 
      Constructor Description
      AES()
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      static Array<byte> encrypt(Array<byte> myIV, Array<byte> myKey, Array<byte> myMsg) Encrypt using AES.
      static Array<byte> decrypt(Array<byte> myIV, Array<byte> myKey, Array<byte> myMsg) Decrypt using AES.
      static Array<byte> decrypt(Array<byte> myIV, Array<byte> myKey, Array<byte> myMsg, int offset, int length) Decryption using AES.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • AES

        AES()
    • Method Detail

      • encrypt

         static Array<byte> encrypt(Array<byte> myIV, Array<byte> myKey, Array<byte> myMsg)

        Encrypt using AES.

        Parameters:
        myIV - Initialization vector (16 bytes)
        myKey - Encryption key (16 bytes)
        myMsg - Message to encrypt
        Returns:

        The cipher text, or null on error.

      • decrypt

         static Array<byte> decrypt(Array<byte> myIV, Array<byte> myKey, Array<byte> myMsg)

        Decrypt using AES.

        Parameters:
        myIV - Initialization vector
        myKey - Decryption key
        myMsg - Cipher text to decrypt
        Returns:

        The plain text, or null on error.

      • decrypt

         static Array<byte> decrypt(Array<byte> myIV, Array<byte> myKey, Array<byte> myMsg, int offset, int length)

        Decryption using AES.

        Parameters:
        myIV - the initialization vector
        myKey - the key
        myMsg - the message
        offset - the offset within the message, pointing at ciphertext
        length - the length of the ciphertext
        Returns:

        the plaintext, or null on error