All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class mit.Rijndael.Rijndael_Algorithm

java.lang.Object
   |
   +----mit.Rijndael.Rijndael_Algorithm

public final class Rijndael_Algorithm
extends Object
Rijndael --pronounced Reindaal-- is a variable block-size (128-, 192- and 256-bit), variable key-size (128-, 192- and 256-bit) symmetric cipher.

Rijndael was written by Vincent Rijmen and Joan Daemen.

Portions of this code are Copyright © 1997, 1998 Systemics Ltd on behalf of the Cryptix Development Team.
All rights reserved.

$Revision: 1.1 $


Constructor Index

 o Rijndael_Algorithm()

Method Index

 o blockDecrypt(byte[], int, Object)
Convenience method to decrypt exactly one block of plaintext, assuming Rijndael's default block size (128-bit).
 o blockDecrypt(byte[], int, Object, int)
Decrypt exactly one block of ciphertext.
 o blockEncrypt(byte[], int, Object)
Convenience method to encrypt exactly one block of plaintext, assuming Rijndael's default block size (128-bit).
 o blockEncrypt(byte[], int, Object, int)
Encrypt exactly one block of plaintext.
 o blockSize()
 o getRounds(int, int)
Return The number of rounds for a given Rijndael's key and block sizes.
 o main(String[])
 o makeKey(byte[])
Convenience method to expand a user-supplied key material into a session key, assuming Rijndael's default block size (128-bit).
 o makeKey(byte[], int)
Expand a user-supplied key material into a session key.
 o self_test()
A basic symmetric encryption/decryption test.

Constructors

 o Rijndael_Algorithm
 public Rijndael_Algorithm()

Methods

 o makeKey
 public static Object makeKey(byte k[]) throws InvalidKeyException
Convenience method to expand a user-supplied key material into a session key, assuming Rijndael's default block size (128-bit).

Parameters:
key - The 128/192/256-bit user-key to use.
Throws: InvalidKeyException
If the key is invalid.
 o blockEncrypt
 public static byte[] blockEncrypt(byte in[],
                                   int inOffset,
                                   Object sessionKey)
Convenience method to encrypt exactly one block of plaintext, assuming Rijndael's default block size (128-bit).

Parameters:
in - The plaintext.
inOffset - Index of in from which to start considering data.
sessionKey - The session key to use for encryption.
Returns:
The ciphertext generated from a plaintext using the session key.
 o blockDecrypt
 public static byte[] blockDecrypt(byte in[],
                                   int inOffset,
                                   Object sessionKey)
Convenience method to decrypt exactly one block of plaintext, assuming Rijndael's default block size (128-bit).

Parameters:
in - The ciphertext.
inOffset - Index of in from which to start considering data.
sessionKey - The session key to use for decryption.
Returns:
The plaintext generated from a ciphertext using the session key.
 o self_test
 public static boolean self_test()
A basic symmetric encryption/decryption test.

 o blockSize
 public static int blockSize()
Returns:
The default length in bytes of the Algorithm input block.
 o makeKey
 public static synchronized Object makeKey(byte k[],
                                           int blockSize) throws InvalidKeyException
Expand a user-supplied key material into a session key.

Parameters:
key - The 128/192/256-bit user-key to use.
blockSize - The block size in bytes of this Rijndael.
Throws: InvalidKeyException
If the key is invalid.
 o blockEncrypt
 public static byte[] blockEncrypt(byte in[],
                                   int inOffset,
                                   Object sessionKey,
                                   int blockSize)
Encrypt exactly one block of plaintext.

Parameters:
in - The plaintext.
inOffset - Index of in from which to start considering data.
sessionKey - The session key to use for encryption.
blockSize - The block size in bytes of this Rijndael.
Returns:
The ciphertext generated from a plaintext using the session key.
 o blockDecrypt
 public static byte[] blockDecrypt(byte in[],
                                   int inOffset,
                                   Object sessionKey,
                                   int blockSize)
Decrypt exactly one block of ciphertext.

Parameters:
in - The ciphertext.
inOffset - Index of in from which to start considering data.
sessionKey - The session key to use for decryption.
blockSize - The block size in bytes of this Rijndael.
Returns:
The plaintext generated from a ciphertext using the session key.
 o 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.
 o main
 public static void main(String args[])

All Packages  Class Hierarchy  This Package  Previous  Next  Index