org.logi.crypto.secretshare
Class SecretShare

java.lang.Object
  |
  +--org.logi.crypto.Crypto
        |
        +--org.logi.crypto.secretshare.SecretShare
Direct Known Subclasses:
PolySecretShare, XorSecretShare

public abstract class SecretShare
extends Crypto

This class stores a share of a secret.

If a secret is m/n-shared this means that n shares are created and that M shares are needed to retrieve the secret.

If the sharing algorithm is secure, then m-1 shares gives no information about the secret.

Author:
Logi Ragnarsson (logir@logi.org)

Fields inherited from class org.logi.crypto.Crypto
BIT, cdsPath, EMPTY_ARRAY, FOUR, keySource, NIBBLE, ONE, primeCertainty, random, TWO, ZERO
 
Constructor Summary
SecretShare(int m, int n)
          Create an object for an m/n share.
 
Method Summary
 int getM()
          Get the number of shares needed to retrieve the secret.
 int getN()
          Get the number of created shares.
static byte[] retrieve(SecretShare[] shares)
          retrieve the secret from an array of shares.
 
Methods inherited from class org.logi.crypto.Crypto
binString, binString, ensureArrayLength, ensureArrayLength, equal, equalRelaxed, equalSub, fromHexNibble, fromHexString, fromString, fromString, hexString, hexString, hexString, hexString, hexString, initRandom, initRandom, makeClass, makeInt, makeLong, makeSessionKey, pastSpace, pickBits, pickBits, prettyPrint, prettyPrint, readBlock, readInt, trimArrayLength, trimArrayLength, trimLeadingZeroes, writeBytes, writeBytes, writeInt
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SecretShare

public SecretShare(int m,
                   int n)
Create an object for an m/n share.
Method Detail

getN

public int getN()
Get the number of created shares.

getM

public int getM()
Get the number of shares needed to retrieve the secret.

retrieve

public static byte[] retrieve(SecretShare[] shares)
                       throws SecretSharingException
retrieve the secret from an array of shares.
Throws:
SecretSharingException - if the secret can't be retrieved.


Copyright (c) 1997-2001 Logi Ragnarsson - Distributed under the GPL