All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class cryptix.provider.rpk.RPKKey

java.lang.Object
   |
   +----cryptix.provider.rpk.MixerGenerator
           |
           +----cryptix.provider.rpk.RPKKey

public class RPKKey
extends MixerGenerator
implements RPKParams, Key, PrivateKey, PublicKey, SecretKey
RPK cryptography relies basically on an instance of a keystream generator that both A and B --the parties wishing to communicate securely-- have to synchronise to the same state (by convention referred to as K). Once the keystream automaton is initialised to the sate K, A creates a ciphertext by combining the plaintext with the keystream output, while B reconstructs the plaintext from the ciphertext by combining the latter with the same keystream output. The combination function in this case being a bit-wise XOR of both sources (plaintext/ciphertext and keystream).

The secure exchange of the value K; ie. the starting state of the keystream automaton, relies on the mathematics of polynomials in the field F 2L = Z 2/f(x), f(x) a primitive polynomial of degree L . In this field, the following formula, which embodies the RPK system, is true:

(x D) R = (x R) D = K (mod f(x))
Written differently, the same equality can be stated as follows:
E R = Q D = K (mod f(x))
In this syntax, E and Q are called states of the keystream generator, while D and R are referred to as distances or exponents, both being represented by this class.

If E is the public key of the recipient, and D is his private one, then transimitting the crucial value of the state K is equivalent to the originator A generating another functionally similar pair (Q, R), and sending only the Q portion to B. In turn, for B to synchronize the keystream generator, he needs to compute Q D , from the state Q and his private key D.

Keys in the RPK scheme are triplets of either states or exponents for RPK Generators --in this case referred to as sub-keys-- combined in one MixerGenerator object. In addition a granularity property (with values from 1 to 8) defines how many bits from the key's Generators output sequence are to be combined with the input stream. The lower the granularity value is, the less secure the output becomes.

To generate new RPK keys, use the getInstance() factory method from java.security.KeyGenerator with "RPK" as the algorithm name, or RPKKeyGenerator() constructor.

FUTURE: change this to be an immutable class.

References:

  1. William M. Raike, The RPK Public-Key Cryptographic System - Technical Summary (available at http://crypto.swdev.co.nz).

  2. William M. Raike, Detailed Supplemental Technical Description of the RPK Public-Key Cryptographic System (available at http://crypto.swdev.co.nz).

Copyright © 1997 Systemics Ltd on behalf of the Cryptix Development Team.
All rights reserved.

$Revision: 1.5 $

Author:
Raif S. Naffah
See Also:
KeyGenerator, RPKKeyGenerator

Constructor Index

 o RPKKey(int[][])
 o RPKKey(int[][], int)

Method Index

 o clone()
Return a reference to a duplicate of this object.
 o exponentiate(RPKKey, RPKKey)
Return a new key, where each subkey is a generator of bKey raised to the power given by the state of the corresponding subkey/generator in eKey.
 o getAlgorithm()
Return the name of the algorithm.
 o getEncoded()
Return a byte representation of this object.
 o getFormat()
Return the encoding format name for this key.
 o getGranularity()
Return the granularity value set for this key.
 o getKeyId()
Compute a CRC32 on the key Raw-encoded material, and then add each successive 4-bit chunck of the CRC 32-bit value to the character 'A' in order to obtain a printable 8-character string that identifies this key.
 o isSameValue(RPKKey)
Return true if the RPKKey x has equal characteristics and contents to this one; false otherwise.
 o isValid()
Test for all-zero-bit and all-one-bit subkeys.
 o toString()
Return a formatted String representation of the binary contents of this.

Constructors

 o RPKKey
 protected RPKKey(int specs[][],
                  int granularity)
 o RPKKey
 protected RPKKey(int specs[][])

Methods

 o clone
 public Object clone()
Return a reference to a duplicate of this object.

Overrides:
clone in class MixerGenerator
 o getAlgorithm
 public String getAlgorithm()
Return the name of the algorithm. For this class RPK.

Returns:
The name of the algorithm. For this class RPK.
 o getFormat
 public String getFormat()
Return the encoding format name for this key. For this class RAW.

Returns:
The encoding format name for this key. For this class RAW.
 o getEncoded
 public byte[] getEncoded()
Return a byte representation of this object. The semantics of the byte sequence is as follows:
 Byte    Length
 offset  (bytes)  Meaning
 0       1        The key's granularity;
 1       2        The raw-encoded byte representation of the
                  underlying Mixer Generator.
 

Returns:
An encoding of this key as a byte array or null if an error occured.
Overrides:
getEncoded in class MixerGenerator
See Also:
getEncoded
 o isValid
 public boolean isValid()
Test for all-zero-bit and all-one-bit subkeys.

Returns:
True iff the contents of each and every generator are not all zeroes or not all ones.
 o isSameValue
 public boolean isSameValue(RPKKey x)
Return true if the RPKKey x has equal characteristics and contents to this one; false otherwise.

NOTE: the equals method is not used, because this is a mutable object (see the requirements for equals in the Java Language Spec).

Returns:
true iff the passed argument is an RPKKey with equal characteristics and contents.
 o getKeyId
 public String getKeyId()
Compute a CRC32 on the key Raw-encoded material, and then add each successive 4-bit chunck of the CRC 32-bit value to the character 'A' in order to obtain a printable 8-character string that identifies this key.

Returns:
An 8-character string that identifies this key.
 o getGranularity
 public int getGranularity()
Return the granularity value set for this key.

Returns:
The granularity value set for this key.
 o exponentiate
 public static RPKKey exponentiate(RPKKey bKey,
                                   RPKKey eKey)
Return a new key, where each subkey is a generator of bKey raised to the power given by the state of the corresponding subkey/generator in eKey.

 o toString
 public String toString()
Return a formatted String representation of the binary contents of this.

Returns:
A formatted string representation of the binary contents of this.
Overrides:
toString in class MixerGenerator

All Packages  Class Hierarchy  This Package  Previous  Next  Index