Class cryptix.security.SPEED
All Packages Class Hierarchy This Package Previous Next Index
Class cryptix.security.SPEED
java.lang.Object
|
+----cryptix.security.BlockCipher
|
+----cryptix.security.SPEED
- public final class SPEED
- extends BlockCipher
SPEED is a block cipher with variable key size, data block
size and number of rounds (in the style of RC5).
This implementation has the key schedule and all variables set
in class instantiation:
-
The key size is taken from the key passed to the constructor,
and can be any even number
of bytes from 6 to 32 (6, 8, 10, ...32).
-
The length of the data block defaults to 8 bytes
(c.f., IDEA and DES).
It can be set by calling the overloaded constructor.
It can be 8, 16, or 32 bytes.
-
The number of rounds
can be any number from 32 upwards, divisible by 4 (32, 36, ...).
It is defaults to 64 (which gives 'adequate' security, see paper below)
or set by calling the variable constructor.
No linked libraries currently supported.
Copyright © 1997
Systemics Ltd
on behalf of the
Cryptix Development Team.
All rights reserved.
Algorithm:
Yuliang Zheng
(public domain). See
Y. Zheng
"The SPEED Cipher,"
Proceedings of Financial Cryptography 97,
Springer-Verlag (forthcoming).
FC97 held at Anguilla, BWI, 24-28 February 1997.
- Author:
- Systemics Ltd
-
SPEED(byte[])
- Create a default SPEED block cipher from a key in a byte array.
-
SPEED(byte[], int, int)
- Create a SPEED block cipher from a key, setting data length and
number of rounds.
-
blockDecrypt(byte[], int, byte[], int)
- Perform a decryption in the extended class.
-
blockEncrypt(byte[], int, byte[], int)
- Perform an encryption in the extended class.
-
blockLength()
- Return data block length of this cipher.
-
blockLengthMax()
- Return the maximum block length.
-
blockLengthMin()
- Return the minimum block length.
-
blockLengthMod()
- Return the modulo block length.
-
keyLength()
- Return key length of this cipher.
-
keyLengthMax()
- Return the maximum key length.
-
keyLengthMin()
- Return the minimum key length.
-
keyLengthMod()
- Return the modulo key length.
-
main(String[])
- Entry point for self_test.
-
numRounds()
- Return number of rounds of this cipher
Default is returned before instantiation, actual returned after.
-
numRoundsMax()
- Return the maximum number of rounds.
-
numRoundsMin()
- Return the minimum number of rounds.
-
numRoundsMod()
- Return the modulo number of rounds.
-
self_test(PrintStream, String[])
- Runs algorithm through test data, including certification data
provided in paper.
SPEED
public SPEED(byte userKey[])
- Create a default SPEED block cipher from a key in a byte array.
The key length is taken from the key provided and should
be one of 6, 8, ..., 32.
Default block size (8) and number of rounds (64) are set
to approximate IDEA or DES, allowing for drop-in replacement.
- Parameters:
- userKey - the user key (length is variable).
SPEED
public SPEED(byte userKey[],
int blockLength,
int numRounds)
- Create a SPEED block cipher from a key, setting data length and
number of rounds.
These are recommended settings for 'adequate' security.
+--------------------------------------------------+
| blockLength | keyLength | numRounds |
|==================================================|
| 8 | >= 8 | >= 64 |
|--------------------------------------------------|
| 16 | >= 8 | >= 48 |
|--------------------------------------------------|
| 32 | >= 8 | >= 48 |
+--------------------------------------------------+
see paper above.
- Parameters:
- userKey - the user key, length can be 6, 8, ... 32.
- blockLength - length of the data block in bytes, 8, 16, 32.
- numRounds - number of rounds to apply, 32, 36 ... %4==0;
blockLength
public int blockLength()
- Return data block length of this cipher.
Default (8 bytes) is returned before instantiation,
actual length used by object returned after instantiation.
- Returns:
- block length in bytes.
- Overrides:
- blockLength in class BlockCipher
blockLengthMax
public int blockLengthMax()
- Return the maximum block length.
- Returns:
- the maximum block length in bytes.
blockLengthMin
public int blockLengthMin()
- Return the minimum block length.
- Returns:
- the minimum block length in bytes.
blockLengthMod
public int blockLengthMod()
- Return the modulo block length.
- Returns:
- the modulo block length in bytes.
keyLength
public int keyLength()
- Return key length of this cipher.
Default is returned before instantiation, actual returned after.
- Returns:
- the key length in bytes.
- Overrides:
- keyLength in class BlockCipher
keyLengthMax
public int keyLengthMax()
- Return the maximum key length.
- Returns:
- the maximum key length.
keyLengthMin
public int keyLengthMin()
- Return the minimum key length.
- Returns:
- the minimum key length.
keyLengthMod
public int keyLengthMod()
- Return the modulo key length.
- Returns:
- the modulo key length.
numRounds
public int numRounds()
- Return number of rounds of this cipher
Default is returned before instantiation, actual returned after.
- Returns:
- the number of rounds.
numRoundsMax
public int numRoundsMax()
- Return the maximum number of rounds.
- Returns:
- the maximum number of rounds.
numRoundsMin
public int numRoundsMin()
- Return the minimum number of rounds.
- Returns:
- the minimum number of rounds.
numRoundsMod
public int numRoundsMod()
- Return the modulo number of rounds.
- Returns:
- the modulo number of rounds.
blockEncrypt
protected void blockEncrypt(byte in[],
int in_offset,
byte out[],
int out_offset)
- Perform an encryption in the extended class.
- Overrides:
- blockEncrypt in class BlockCipher
blockDecrypt
protected void blockDecrypt(byte in[],
int in_offset,
byte out[],
int out_offset)
- Perform a decryption in the extended class.
- Overrides:
- blockDecrypt in class BlockCipher
main
public final static void main(String argv[])
- Entry point for self_test.
self_test
public static void self_test(PrintStream out,
String argv[]) throws Exception
- Runs algorithm through test data, including certification data
provided in paper.
All Packages Class Hierarchy This Package Previous Next Index