|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--jrun.security.Twofish_Algorithm
Twofish is an AES candidate algorithm. It is a balanced 128-bit Feistel cipher, consisting of 16 rounds. In each round, a 64-bit S-box value is computed from 64 bits of the block, and this value is xored into the other half of the block. The two half-blocks are then exchanged, and the next round begins. Before the first round, all input bits are xored with key- dependent "whitening" subkeys, and after the final round the output bits are xored with other key-dependent whitening subkeys; these subkeys are not used anywhere else in the algorithm.
Twofish was submitted by Bruce Schneier, Doug Whiting, John Kelsey, Chris Hall and David Wagner.
Reference:
Copyright © 1998
Systemics Ltd on behalf of the
Cryptix Development Team.
All rights reserved.
$Revision: $
| Constructor Summary | |
Twofish_Algorithm()
|
|
| Method Summary | |
static byte[] |
blockDecrypt(byte[] in,
int inOffset,
java.lang.Object sessionKey)
Decrypt exactly one block of ciphertext. |
static byte[] |
blockEncrypt(byte[] in,
int inOffset,
java.lang.Object sessionKey)
Encrypt exactly one block of plaintext. |
static int |
blockSize()
|
static void |
main(java.lang.String[] args)
|
static java.lang.Object |
makeKey(byte[] k)
Expand a user-supplied key material into a session key. |
static boolean |
self_test()
A basic symmetric encryption/decryption test. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public Twofish_Algorithm()
| Method Detail |
public static java.lang.Object makeKey(byte[] k)
throws java.security.InvalidKeyException
key - The 64/128/192/256-bit user-key to use.java.security.InvalidKeyException - If the key is invalid.
public static byte[] blockEncrypt(byte[] in,
int inOffset,
java.lang.Object sessionKey)
in - The plaintext.inOffset - Index of in from which to start considering data.sessionKey - The session key to use for encryption.
public static byte[] blockDecrypt(byte[] in,
int inOffset,
java.lang.Object sessionKey)
in - The ciphertext.inOffset - Index of in from which to start considering data.sessionKey - The session key to use for decryption.public static boolean self_test()
public static int blockSize()
public static void main(java.lang.String[] args)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||