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:

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

Constructor Index

 o SPEED(byte[])
Create a default SPEED block cipher from a key in a byte array.
 o SPEED(byte[], int, int)
Create a SPEED block cipher from a key, setting data length and number of rounds.

Method Index

 o blockDecrypt(byte[], int, byte[], int)
Perform a decryption in the extended class.
 o blockEncrypt(byte[], int, byte[], int)
Perform an encryption in the extended class.
 o blockLength()
Return data block length of this cipher.
 o blockLengthMax()
Return the maximum block length.
 o blockLengthMin()
Return the minimum block length.
 o blockLengthMod()
Return the modulo block length.
 o keyLength()
Return key length of this cipher.
 o keyLengthMax()
Return the maximum key length.
 o keyLengthMin()
Return the minimum key length.
 o keyLengthMod()
Return the modulo key length.
 o main(String[])
Entry point for self_test.
 o numRounds()
Return number of rounds of this cipher Default is returned before instantiation, actual returned after.
 o numRoundsMax()
Return the maximum number of rounds.
 o numRoundsMin()
Return the minimum number of rounds.
 o numRoundsMod()
Return the modulo number of rounds.
 o self_test(PrintStream, String[])
Runs algorithm through test data, including certification data provided in paper.

Constructors

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

Methods

 o 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
 o blockLengthMax
  public int blockLengthMax()
Return the maximum block length.
Returns:
the maximum block length in bytes.
 o blockLengthMin
  public int blockLengthMin()
Return the minimum block length.
Returns:
the minimum block length in bytes.
 o blockLengthMod
  public int blockLengthMod()
Return the modulo block length.
Returns:
the modulo block length in bytes.
 o 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
 o keyLengthMax
  public int keyLengthMax()
Return the maximum key length.
Returns:
the maximum key length.
 o keyLengthMin
  public int keyLengthMin()
Return the minimum key length.
Returns:
the minimum key length.
 o keyLengthMod
  public int keyLengthMod()
Return the modulo key length.
Returns:
the modulo key length.
 o numRounds
  public int numRounds()
Return number of rounds of this cipher Default is returned before instantiation, actual returned after.
Returns:
the number of rounds.
 o numRoundsMax
  public int numRoundsMax()
Return the maximum number of rounds.
Returns:
the maximum number of rounds.
 o numRoundsMin
  public int numRoundsMin()
Return the minimum number of rounds.
Returns:
the minimum number of rounds.
 o numRoundsMod
  public int numRoundsMod()
Return the modulo number of rounds.
Returns:
the modulo number of rounds.
 o 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
 o 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
 o main
  public final static void main(String argv[])
Entry point for self_test.
 o 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