cryptix.security
Class SPEED

java.lang.Object
  extended bycryptix.security.BlockCipher
      extended bycryptix.security.SPEED

public class SPEED
extends BlockCipher

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.10 $

Since:
Cryptix 2.2
Author:
Systemics Ltd, David Hopwood
See Also:
java.security.Cipher#getInstance

Field Summary
 
Fields inherited from class cryptix.security.BlockCipher
blockSize, cipher
 
Constructor Summary
SPEED(byte[] userKey)
          Deprecated. This creates a SPEED block cipher instance, with key data taken from a byte array of a user-defined length.
SPEED(byte[] userKey, int blockSize, int rounds)
          Deprecated. 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 Summary
static int blockLengthMax()
          Deprecated. Returns the maximum block length.
static int blockLengthMin()
          Deprecated. Returns the minimum block length.
static int blockLengthMod()
          Deprecated. Returns the modulo block length.
static int keyLengthMax()
          Deprecated. Returns the maximum key length.
static int keyLengthMin()
          Deprecated. Returns the minimum key length.
static int keyLengthMod()
          Deprecated. Returns the modulo key length.
static void main(java.lang.String[] args)
          Deprecated. Entry point for self_test.
 int numRounds()
          Deprecated. Returns the number of rounds for this cipher.
static int numRoundsMax()
          Deprecated. Returns the maximum number of rounds.
static int numRoundsMin()
          Deprecated. Returns the minimum number of rounds.
static int numRoundsMod()
          Deprecated. Returns the modulo number of rounds.
static void self_test()
          Deprecated. Do some basic tests.
 
Methods inherited from class cryptix.security.BlockCipher
blockLength, decrypt, decrypt, decrypt, encrypt, encrypt, encrypt, keyLength
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SPEED

public SPEED(byte[] userKey)
Deprecated. 
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)
Deprecated. 
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
Method Detail

blockLengthMax

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

Returns:
the maximum block length in bytes.

blockLengthMin

public static final int blockLengthMin()
Deprecated. 
Returns the minimum block length.

Returns:
the minimum block length in bytes.

blockLengthMod

public static final int blockLengthMod()
Deprecated. 
Returns the modulo block length.

Returns:
the modulo block length in bytes.

keyLengthMax

public static final int keyLengthMax()
Deprecated. 
Returns the maximum key length.

Returns:
the maximum key length in bytes.

keyLengthMin

public static final int keyLengthMin()
Deprecated. 
Returns the minimum key length.

Returns:
the minimum key length in bytes.

keyLengthMod

public static final int keyLengthMod()
Deprecated. 
Returns the modulo key length.

Returns:
the modulo key length in bytes.

numRoundsMax

public static final int numRoundsMax()
Deprecated. 
Returns the maximum number of rounds.

Returns:
the maximum number of rounds.

numRoundsMin

public static final int numRoundsMin()
Deprecated. 
Returns the minimum number of rounds.

Returns:
the minimum number of rounds.

numRoundsMod

public static final int numRoundsMod()
Deprecated. 
Returns the modulo number of rounds.

Returns:
the modulo number of rounds.

numRounds

public final int numRounds()
Deprecated. 
Returns the number of rounds for this cipher.

Returns:
the number of rounds.

main

public static void main(java.lang.String[] args)
Deprecated. 
Entry point for self_test.


self_test

public static void self_test()
                      throws CryptoError
Deprecated. 
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!

Throws:
CryptoError
See Also:
cryptix.examples.TestSPEED