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:

SPEED was designed by Yuliang Zheng, and is in the public domain.

References:

  1. 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

Constructor Index

 o SPEED(byte[])
This creates a SPEED block cipher instance, with key data taken from a byte array of a user-defined length.
 o 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.

Method Index

 o blockLengthMax()
Returns the maximum block length.
 o blockLengthMin()
Returns the minimum block length.
 o blockLengthMod()
Returns the modulo block length.
 o keyLengthMax()
Returns the maximum key length.
 o keyLengthMin()
Returns the minimum key length.
 o keyLengthMod()
Returns the modulo key length.
 o main(String[])
Entry point for self_test.
 o numRounds()
Returns the number of rounds for this cipher.
 o numRoundsMax()
Returns the maximum number of rounds.
 o numRoundsMin()
Returns the minimum number of rounds.
 o numRoundsMod()
Returns the modulo number of rounds.
 o self_test()
Do some basic tests.

Constructors

 o 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.
 o 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

Methods

 o blockLengthMax
 public static final int blockLengthMax()
Returns the maximum block length.

Returns:
the maximum block length in bytes.
 o blockLengthMin
 public static final int blockLengthMin()
Returns the minimum block length.

Returns:
the minimum block length in bytes.
 o blockLengthMod
 public static final int blockLengthMod()
Returns the modulo block length.

Returns:
the modulo block length in bytes.
 o keyLengthMax
 public static final int keyLengthMax()
Returns the maximum key length.

Returns:
the maximum key length in bytes.
 o keyLengthMin
 public static final int keyLengthMin()
Returns the minimum key length.

Returns:
the minimum key length in bytes.
 o keyLengthMod
 public static final int keyLengthMod()
Returns the modulo key length.

Returns:
the modulo key length in bytes.
 o numRoundsMax
 public static final int numRoundsMax()
Returns the maximum number of rounds.

Returns:
the maximum number of rounds.
 o numRoundsMin
 public static final int numRoundsMin()
Returns the minimum number of rounds.

Returns:
the minimum number of rounds.
 o numRoundsMod
 public static final int numRoundsMod()
Returns the modulo number of rounds.

Returns:
the modulo number of rounds.
 o numRounds
 public final int numRounds()
Returns the number of rounds for this cipher.

Returns:
the number of rounds.
 o main
 public static void main(String args[])
Entry point for self_test.

 o 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