public class SecretSharingGenerator
extends java.lang.Object
Constructor and Description |
---|
SecretSharingGenerator() |
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
combine(java.lang.String[] encodedSecretPhrasePieces)
Given minPieces pieces out of totalPieces of a secretPhrase, combine the pieces into the original phrase.*
Pieces are formatted as [version]:[split id]:[total pieces]:[minimum pieces]:[prime field size or zero]:[piece number]:[piece content]
|
static java.math.BigInteger |
getModPrime(java.lang.String secretPhrase)
Given a secret phrase calculate the modulo prime finite field size which is sufficiently large to split the
shared secrets
|
static java.lang.String[] |
split(java.lang.String secretPhrase,
int totalPieces,
int minPieces,
java.math.BigInteger declaredModePrime)
Given a secretPhrase split it into totalPieces pieces where each minPieces of them are enough to reproduce the secret.
|
public static java.lang.String[] split(java.lang.String secretPhrase, int totalPieces, int minPieces, java.math.BigInteger declaredModePrime)
secretPhrase
- the secret phrasetotalPieces
- the number of generated piecesminPieces
- the number of pieces needed to reproduce the secret phrasedeclaredModePrime
- the modulo prime used for secret sharing calculations. Specify BigInteger.ZERO to calculate automaticallypublic static java.lang.String combine(java.lang.String[] encodedSecretPhrasePieces)
encodedSecretPhrasePieces
- the pieces of the secret phrase formatted as specified abovepublic static java.math.BigInteger getModPrime(java.lang.String secretPhrase)
secretPhrase
- the secret phrase