<commit_before>Java Threshold Secret Sharing
===

## Description
Core implementation of Threshold Secret Sharing (TSS) [http://tools.ietf.org/html/draft-mcgrew-tss-03](http://tools.ietf.org/html/draft-mcgrew-tss-03)
  It uses a finite field GF(256) instead of Shamir scheme using large integers modulo a large prime number. 
  Max number of shares is 255, max secret key bytes is 65535. 

  [https://github.com/antik10ud/threshold-secret-sharing/blob/master/src/main/java/com/k10ud/cryptography/tss/core/ThresholdSecretSharing.java](KISS code)
  [https://github.com/antik10ud/threshold-secret-sharing/blob/master/src/test/java/com/k10ud/cryptography/tss/core/ThresholdSecretSharingTest.java](Tested code)


## Requirements
Java 1.7 (But probably works with older versions) 

## Compile, Test & Package
    $ mvn package

## Example
    ThresholdSecretSharing tss = new ThresholdSecretSharing();

    # Create 5 shares, secret recoverable from at least 3 different shares

	byte[] secret = Hex.convert("7465737400");
	byte[][] shares = tss.createShares(secret, 5, 3, new SecureRandom());

    # Recover secret from two shares
	
	byte[][] shares = { Hex.convert("FFB9FA07E185"), Hex.convert("00F5409B4511") };
	byte[] secret = tss.recoverSecret(shares);
		<commit_msg>swap href-text <commit_after>Java Threshold Secret Sharing
===

## Description
Core implementation of Threshold Secret Sharing (TSS) [http://tools.ietf.org/html/draft-mcgrew-tss-03](http://tools.ietf.org/html/draft-mcgrew-tss-03)
  It uses a finite field GF(256) instead of Shamir scheme using large integers modulo a large prime number. 
  Max number of shares is 255, max secret key bytes is 65535. 

  [KISS code](https://github.com/antik10ud/threshold-secret-sharing/blob/master/src/main/java/com/k10ud/cryptography/tss/core/ThresholdSecretSharing.java)
  [Tested code](https://github.com/antik10ud/threshold-secret-sharing/blob/master/src/test/java/com/k10ud/cryptography/tss/core/ThresholdSecretSharingTest.java)


## Requirements
Java 1.7 (But probably works with older versions) 

## Compile, Test & Package
    $ mvn package

## Example
    ThresholdSecretSharing tss = new ThresholdSecretSharing();

    # Create 5 shares, secret recoverable from at least 3 different shares

	byte[] secret = Hex.convert("7465737400");
	byte[][] shares = tss.createShares(secret, 5, 3, new SecureRandom());

    # Recover secret from two shares
	
	byte[][] shares = { Hex.convert("FFB9FA07E185"), Hex.convert("00F5409B4511") };
	byte[] secret = tss.recoverSecret(shares);
		
{'fraction_non_alphanumeric': 0.12273086029992107, 'fraction_numerical': 0.043409629044988164, 'mean_word_length': 4.633333333333334, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2287311', 'n_tokens_mistral': 922, 'n_tokens_neox': 800, 'n_words': 200}