com.mindbright.security.cipher
Class Rijndael
java.lang.Object
com.mindbright.jce.crypto.CipherSpi
com.mindbright.security.cipher.BlockCipher
com.mindbright.security.cipher.Rijndael
- public final class Rijndael
- extends BlockCipher
Method Summary |
void |
blockDecrypt(byte[] in,
int inOffset,
byte[] out,
int outOffset)
Convenience method to decrypt exactly one block of plaintext, assuming
Rijndael's default block size (128-bit). |
void |
blockEncrypt(byte[] in,
int inOffset,
byte[] out,
int outOffset)
Convenience method to encrypt exactly one block of plaintext, assuming
Rijndael's default block size (128-bit). |
int |
getBlockSize()
|
static int |
getRounds(int keySize,
int blockSize)
Return The number of rounds for a given Rijndael's key and block sizes. |
void |
initializeKey(byte[] key)
Expand a user-supplied key material into a session key. |
Methods inherited from class com.mindbright.security.cipher.BlockCipher |
engineDoFinal, engineGetBlockSize, engineGetIV, engineGetOutputSize, engineInit, engineInit, engineSetMode, engineSetPadding, getIntLSBO, getIntMSBO, nboIncr, putIntLSBO, putIntMSBO |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Rijndael
public Rijndael()
getBlockSize
public int getBlockSize()
- Specified by:
getBlockSize
in class BlockCipher
initializeKey
public void initializeKey(byte[] key)
throws InvalidKeyException
- Expand a user-supplied key material into a session key.
- Specified by:
initializeKey
in class BlockCipher
- Parameters:
key
- The 128/192/256-bit user-key to use.
- Throws:
InvalidKeyException
- If the key is invalid.
blockEncrypt
public void blockEncrypt(byte[] in,
int inOffset,
byte[] out,
int outOffset)
- Convenience method to encrypt exactly one block of plaintext, assuming
Rijndael's default block size (128-bit).
- Specified by:
blockEncrypt
in class BlockCipher
- Parameters:
in
- The plaintext.inOffset
- Index of in from which to start considering data.out
- The ciphertext.outOffset
- Index in out where output of ciphertext should start.
blockDecrypt
public void blockDecrypt(byte[] in,
int inOffset,
byte[] out,
int outOffset)
- Convenience method to decrypt exactly one block of plaintext, assuming
Rijndael's default block size (128-bit).
- Specified by:
blockDecrypt
in class BlockCipher
- Parameters:
in
- The ciphertext.inOffset
- Index of in from which to start considering data.out
- The plaintext.outOffset
- Index in out where output of plaintext should start.
getRounds
public static int getRounds(int keySize,
int blockSize)
- Return The number of rounds for a given Rijndael's key and block sizes.
- Parameters:
keySize
- The size of the user key material in bytes.blockSize
- The desired block size in bytes.
- Returns:
- The number of rounds for a given Rijndael's key and
block sizes.