|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object tribble.crypto.AbstractCipher tribble.crypto.SymmetricCipher tribble.crypto.AESCipher
AES encryption standard algorithm (also known as Rijndael). Rijndael (pronounced rain'doll) is a symmetric cipher with a 128-bit block size and a variable key size (128-bit, 192-bit, and 256-bit).
Rijndael is the United States AES encryption standard algorithm, which supersedes the previous DES encryption standard.
Acknowledgements
Rijndael was designed by Vincent Rijmen (rijmen@esat.kuleuven.ac.be) and Joan Daemen (daemen.j@protonworld.com).
This implementation was derived from source originally written by Cryptix:
Rijndael.java 1.8 2000/10/02Copyright ©1995-2000 The Cryptix Foundation Limited. All rights reserved.
Use, modification, copying and distribution of this software is subject the terms and conditions of the Cryptix General Licence. You should have received a copy of the Cryptix General Licence along with this library; if not, you can download a copy from <http://www.cryptix.org/>.
THIS CODE MAY BE SUBJECT TO U.S. EXPORT RESTRICTIONS, AND SHOULD NOT BE EXPORTED OUTSIDE THE BORDERS OF THE UNITED STATES OF AMERICA.
Field Summary |
Fields inherited from class tribble.crypto.SymmetricCipher |
m_blockLen |
Fields inherited from class tribble.crypto.AbstractCipher |
m_alg, m_decrypt, m_init, m_keyLen |
Constructor Summary | |
AESCipher()
Default constructor. |
Method Summary | |
protected void |
blockDecrypt(byte[] in,
int inOff,
byte[] out,
int outOff)
Decrypt a block of ciphertext. |
protected void |
blockEncrypt(byte[] in,
int inOff,
byte[] out,
int outOff)
Encrypt a block of plaintext. |
protected void |
clear()
Reset this cipher, wiping all sensitive information. |
int[] |
getKeySizes()
Retrieve the key sizes supported by this cipher. |
protected void |
initialize(byte[] key,
boolean decrypt)
Initialize this cipher. |
static void |
main(java.lang.String[] args)
Test driver. |
Methods inherited from class tribble.crypto.SymmetricCipher |
getBlockSize, test, test |
Methods inherited from class tribble.crypto.AbstractCipher |
finalize, getAlgorithm, getKeySize |
Methods inherited from class java.lang.Object |
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public AESCipher()
Method Detail |
public static final void main(java.lang.String[] args) throws java.lang.Exception
Usage java tribble.crypto.AESCipher [args...]
args
- Command line arguments.
java.lang.Exception
- Thrown if an error occurs in the encryption engine.public int[] getKeySizes()
getKeySizes
in class AbstractCipher
AbstractCipher.getKeySize()
protected void initialize(byte[] key, boolean decrypt) throws java.security.InvalidKeyException
initialize
in class AbstractCipher
key
- The symmetric (secret) encryption key for this cipher.decrypt
- If true, this indicates that this cipher is to be initialized for
decrypting, otherwise it is to be initialized for encrypting.
java.security.InvalidKeyException
clear()
protected void clear()
This method will be called after this cipher object is no longer needed. It should overwrite any sensitive data contained within this object (e.g., encryption key schedules). This cipher object can no longer be used after this method has been called.
clear
in class AbstractCipher
initialize()
protected void blockEncrypt(byte[] in, int inOff, byte[] out, int outOff)
blockEncrypt
in class SymmetricCipher
in
- Array containing a single block of plaintext bytes to encrypt.
The length of the block is exactly equal to the cipher block size.inOff
- Index of the first byte of the plaintext block within array in to
encrypt.out
- Array that will be filled with the encrypted ciphertext block.
The length of the block is exactly equal to the cipher block size.outOff
- Index of the first byte of array out to fill with the encrypted
ciphertext block.blockDecrypt(byte[], int, byte[], int)
protected void blockDecrypt(byte[] in, int inOff, byte[] out, int outOff)
blockDecrypt
in class SymmetricCipher
in
- Array containing a single block of ciphertext bytes to decrypt.
The length of the block is exactly equal to the cipher block size.inOff
- Index of the first byte of the ciphertext block within array in
to decrypt.out
- Array that will be filled with the decrypted plaintext block.
The length of the block is exactly equal to the cipher block size.outOff
- Index of the first byte of array out to fill with the decrypted
plaintext block.blockEncrypt(byte[], int, byte[], int)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |