Skip to content

mythosil/sss4j

Repository files navigation

sss4j (Secret Sharing Scheme for Java)

Build Status

Library project of Shamir's Secret Sharing Scheme.

Usage

Gradle

dependencies {
  compile 'com.mythosil:sss4j:1.0.0'
}

Example codes

byte[] secret = "wanna make this secret".getBytes();

// (2, 3)-threshold secret share
List<Share> shares = Sss4j.split(secret, 2, 3);

// reconstruct secret from 2 shares only
List<Share> twoShares = shares.subList(0, 2);
byte[] combined = Sss4j.combine(twoShares);

// secret == combined

// issue another (4th) share
Share anotherShare = Sss4j.issue(shares, 4);

License