All Packages Class Hierarchy This Package Previous Next Index
Class cryptix.security.SPEED
java.lang.Object
|
+----cryptix.security.BlockCipher
|
+----cryptix.security.SPEED
- public class SPEED
- extends BlockCipher
Note: SPEED is deprecated.
This class implements the Cryptix V2.2 API for the SPEED block cipher.
New code should use the JCA implementation of SPEED, which can be obtained
by calling Cipher.getInstance("SPEED")
, for example.
SPEED is a block cipher with variable key size, data block size and number
of rounds (in the style of RC5).
This implementation sets the key schedule and all variables when the
cipher is initialized:
-
The key size is taken from the array 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, and can be
8, 16, or 32 bytes.
-
The number of rounds can be any number from 32 upwards, divisible by
4 (32, 36, ...).
It defaults to 64 (which gives 'adequate' security, see paper below)
and is also set by calling the overloaded constructor.
SPEED was designed by Yuliang Zheng,
and is in the public domain.
References:
- Y. Zheng
"The SPEED Cipher,"
Proceedings of Financial Cryptography 97,
Springer-Verlag (forthcoming).
FC97 held at Anguilla, BWI, 24-28 February 1997.
Copyright © 1997
Systemics Ltd
on behalf of the
Cryptix Development Team.
All rights reserved.
$Revision: 1.7 $
- Author:
- Systemics Ltd, David Hopwood
- See Also:
- getInstance
-
SPEED(byte[])
- This creates a SPEED block cipher instance, with key data taken
from a byte array of a user-defined length.
-
SPEED(byte[], int, int)
- This creates a SPEED block cipher instance, with key data taken
from a byte array of a user-defined length, and with a specified
block size and number of rounds.
-
blockLengthMax()
- Returns the maximum block length.
-
blockLengthMin()
- Returns the minimum block length.
-
blockLengthMod()
- Returns the modulo block length.
-
keyLengthMax()
- Returns the maximum key length.
-
keyLengthMin()
- Returns the minimum key length.
-
keyLengthMod()
- Returns the modulo key length.
-
main(String[])
- Entry point for
self_test
.
-
numRounds()
- Returns the number of rounds for this cipher.
-
numRoundsMax()
- Returns the maximum number of rounds.
-
numRoundsMin()
- Returns the minimum number of rounds.
-
numRoundsMod()
- Returns the modulo number of rounds.
-
self_test()
- Do some basic tests.
SPEED
public SPEED(byte userKey[])
- This creates a SPEED block cipher instance, with key data taken
from a byte array of a user-defined length. The key length should
be an even number between 6 and 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.
- Throws: CryptoError
- if an error occurs initializing the cipher.
SPEED
public SPEED(byte userKey[],
int blockSize,
int rounds)
- This creates a SPEED block cipher instance, with key data taken
from a byte array of a user-defined length, and with a specified
block size and number of rounds. The key length should be an even
number between 6 and 32.
These are recommended settings for 'adequate' security:
+--------------------------------------------------+
| block size | key length | rounds |
|==================================================|
| 8 | >= 8 | >= 64 |
|--------------------------------------------------|
| 16 | >= 8 | >= 48 |
|--------------------------------------------------|
| 32 | >= 8 | >= 48 |
+--------------------------------------------------+
Also see the paper referenced above.
- Parameters:
- userKey - the user key, length can be 6, 8, ... 32 bytes
- blockSize - the block size in bytes: 8, 16 or 32
- rounds - the number of rounds: >= 32, multiple of 4
blockLengthMax
public static final int blockLengthMax()
- Returns the maximum block length.
- Returns:
- the maximum block length in bytes.
blockLengthMin
public static final int blockLengthMin()
- Returns the minimum block length.
- Returns:
- the minimum block length in bytes.
blockLengthMod
public static final int blockLengthMod()
- Returns the modulo block length.
- Returns:
- the modulo block length in bytes.
keyLengthMax
public static final int keyLengthMax()
- Returns the maximum key length.
- Returns:
- the maximum key length in bytes.
keyLengthMin
public static final int keyLengthMin()
- Returns the minimum key length.
- Returns:
- the minimum key length in bytes.
keyLengthMod
public static final int keyLengthMod()
- Returns the modulo key length.
- Returns:
- the modulo key length in bytes.
numRoundsMax
public static final int numRoundsMax()
- Returns the maximum number of rounds.
- Returns:
- the maximum number of rounds.
numRoundsMin
public static final int numRoundsMin()
- Returns the minimum number of rounds.
- Returns:
- the minimum number of rounds.
numRoundsMod
public static final int numRoundsMod()
- Returns the modulo number of rounds.
- Returns:
- the modulo number of rounds.
numRounds
public final int numRounds()
- Returns the number of rounds for this cipher.
- Returns:
- the number of rounds.
main
public static void main(String args[])
- Entry point for
self_test
.
self_test
public static void self_test() throws CryptoError
- Do some basic tests.
Three of the certification data are included only, no output,
success or exception.
If you want more, write a test program!
- See Also:
- TestSPEED
All Packages Class Hierarchy This Package Previous Next Index