Documentation of 'edu.rit.crypto.blockcipher.AES256CipherSmp' Java class
AES256CipherSmp
edu.rit.crypto.blockcipher

Class AES256CipherSmp



  • public class AES256CipherSmp
    extends BlockCipher
    Class AES256CipherSmp provides a BlockCipher using the Advanced Encryption Standard (AES) with a 128-bit (16-byte) block length and a 256-bit (32-byte) key length. The AES specification may be found at http://csrc.nist.gov/publications/fips/fips197/fips-197.pdf.

    Unlike class AES256Cipher, class AES256CipherSmp includes extra padding in the memory layout to avoid cache interference when running a program with multiple threads on an SMP parallel computer.

    Note: However, class AES256CipherSmp is not multiple thread safe.

    • Constructor Summary

      Constructors 
      Constructor and Description
      AES256CipherSmp(byte[] theKey)
      Construct a new AES-256 cipher object with the given secret key.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      void encrypt(byte[] thePlaintext, byte[] theCiphertext)
      Encrypt the given plaintext block.
      void erase()
      Erase this block cipher object's key material.
      void setKey(byte[] theKey)
      Set the key to be used for all subsequent encryptions and decryptions.
      • Methods inherited from class java.lang.Object

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

      • AES256CipherSmp

        public AES256CipherSmp(byte[] theKey)
        Construct a new AES-256 cipher object with the given secret key. After the constructor returns, theKey is no longer needed and may be erased (set to all 0s). The length of theKey must be at least 32. Only the first 32 bytes are used.
        Parameters:
        theKey - Key (byte array).
        Throws:
        java.lang.NullPointerException - (unchecked exception) Thrown if theKey is null.
        java.lang.IllegalArgumentException - (unchecked exception) Thrown if theKey.length < 32.
    • Method Detail

      • setKey

        public void setKey(byte[] theKey)
        Set the key to be used for all subsequent encryptions and decryptions. After this method returns, theKey is no longer needed and may be erased (set to all 0s). The length of theKey must be at least 32. Only the first 32 bytes are used.
        Specified by:
        setKey in class BlockCipher
        Parameters:
        theKey - Key (byte array).
        Throws:
        java.lang.NullPointerException - (unchecked exception) Thrown if theKey is null.
        java.lang.IllegalArgumentException - (unchecked exception) Thrown if theKey.length < 32.
      • encrypt

        public void encrypt(byte[] thePlaintext,
                            byte[] theCiphertext)
        Encrypt the given plaintext block. On input, thePlaintext contains the plaintext. On output, the contents of theCiphertext have been replaced by the ciphertext. thePlaintext and theCiphertext may be the same block. The length of thePlaintext must be at least 16. Only the first 16 bytes are read. The length of theCiphertext must be at least 16. Only the first 16 bytes are written.
        Specified by:
        encrypt in class BlockCipher
        Parameters:
        thePlaintext - Input plaintext block to be encrypted.
        theCiphertext - Output ciphertext block.
        Throws:
        java.lang.NullPointerException - (unchecked exception) Thrown if thePlaintext is null or theCiphertext is null.
        java.lang.IllegalArgumentException - (unchecked exception) Thrown if thePlaintext.length < 16 or theCiphertext.length < 16.
        java.lang.IllegalStateException - (unchecked exception) Thrown if the key has been erased and not re-set.
      • erase

        public void erase()
        Erase this block cipher object's key material.
        Specified by:
        erase in class BlockCipher

DMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.