org.gregoire.util.crypto
Class Rijndael

java.lang.Object
  extended byorg.gregoire.util.crypto.Rijndael
All Implemented Interfaces:
BlockCipher

public class Rijndael
extends java.lang.Object
implements BlockCipher

Interfaces with the Rijndael AES candidate to implement the Rijndael algorithm


Constructor Summary
Rijndael()
           
Rijndael(int keysize)
           
Rijndael(java.lang.Integer keysize)
           
Rijndael(int keysize, int blocksize)
           
 
Method Summary
 void decrypt(byte[] block, byte[] result)
          Deciphers the contents of block where block must be equal to getBlockSize()/8.
 void encrypt(byte[] block, byte[] result)
          Enciphers the contents of block where block must be equal to getBlockSize()/8.
 int getBlockSize()
          Returns the block size, in bits, of the given block-cipher
 int getKeySize()
          Returns the key size, in bits, of the given block-cipher
 void initialize(byte[] key)
          Initializes the cipher context with the given key.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Rijndael

public Rijndael(java.lang.Integer keysize)
         throws java.security.InvalidKeyException

Rijndael

public Rijndael(int keysize)
         throws java.security.InvalidKeyException

Rijndael

public Rijndael(int keysize,
                int blocksize)
         throws java.security.InvalidKeyException

Rijndael

public Rijndael()
Method Detail

getBlockSize

public final int getBlockSize()
Description copied from interface: BlockCipher
Returns the block size, in bits, of the given block-cipher

Specified by:
getBlockSize in interface BlockCipher

getKeySize

public final int getKeySize()
Description copied from interface: BlockCipher
Returns the key size, in bits, of the given block-cipher

Specified by:
getKeySize in interface BlockCipher

initialize

public void initialize(byte[] key)
Description copied from interface: BlockCipher
Initializes the cipher context with the given key. This might entail performing pre-encryption calculation of subkeys, S-Boxes, etc.

Specified by:
initialize in interface BlockCipher

encrypt

public final void encrypt(byte[] block,
                          byte[] result)
Description copied from interface: BlockCipher
Enciphers the contents of block where block must be equal to getBlockSize()/8. The result is placed in result and, too has to have length getBlockSize()/8. Block and result may refer to the same array. Warning: It is not a guarantee that block will not be over- written in the course of the algorithm

Specified by:
encrypt in interface BlockCipher

decrypt

public final void decrypt(byte[] block,
                          byte[] result)
Description copied from interface: BlockCipher
Deciphers the contents of block where block must be equal to getBlockSize()/8. The result is placed in result and, too has to have length getBlockSize()/8. Block and result may refer to the same array. Warning: It is not a guarantee that block will not be over- written in the course of the algorithm

Specified by:
decrypt in interface BlockCipher


Copyright © Paul Gregoire, All Rights Reserved.