Package com.uc4.util

Class AES


  • public final class AES
    extends java.lang.Object
    Rijndael.java
    Version:
    1.0 (May 2001) Optimised Java implementation of the Rijndael (AES) block cipher.
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  AES.Mode
      encryption operating modes
    • Constructor Summary

      Constructors 
      Constructor Description
      AES()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void CMNDecrypt​(byte[] buf, int start, int len, byte[] IV)
      used to decrypt a byte buffer.
      void CMNEncrypt​(byte[] buf, int start, int len, byte[] IV)
      used to encrypt a byte buffer.
      void encFree()
      used to free allocated resources.
      protected void finalize()
      Destroy all sensitive information in this object.
      void initializeEnc​(byte[] Key, int KeyLen, AES.Mode m)
      initialize the encryption class.
      • Methods inherited from class java.lang.Object

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

      • AES

        public AES()
    • Method Detail

      • initializeEnc

        public void initializeEnc​(byte[] Key,
                                  int KeyLen,
                                  AES.Mode m)
        initialize the encryption class. to encrypt use CMNEncrypt to decrypt use CMNDecrypt
        Parameters:
        Key - the key to be used
        KeyLen - the active key length
        m - the operation mode CBC - ECB
      • CMNEncrypt

        public void CMNEncrypt​(byte[] buf,
                               int start,
                               int len,
                               byte[] IV)
        used to encrypt a byte buffer. use InitializeEnc to initialize the class.
        Parameters:
        buf - the byte buffer to be encrypted
        start - the encryption start position in the byte buffer
        len - the length to be encrypted
        IV - the initial vector to be used
      • CMNDecrypt

        public void CMNDecrypt​(byte[] buf,
                               int start,
                               int len,
                               byte[] IV)
        used to decrypt a byte buffer. use InitializeEnc to initialize the class.
        Parameters:
        buf - the byte buffer to be decrypted
        start - the decryption start position in the byte buffer
        len - the length to be decrypted
        IV - the initial vector to be used
      • encFree

        public void encFree()
        used to free allocated resources. and sensitive data will be wiped out
      • finalize

        protected final void finalize()
        Destroy all sensitive information in this object.
        Overrides:
        finalize in class java.lang.Object