Skip to content

kavir1698/ShamirSSS.jl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ShamirSSS.jl

A Julia package implementing Shamir's Secret Sharing Scheme.

Overview

Shamir's Secret Sharing Scheme is a cryptographic technique for securely sharing a secret among multiple parties. This package provides two primary functions:

  • split_secret: splits a secret string into multiple shares, with a specified threshold required for reconstruction.
  • reconstruct_secret: reconstructs the original secret string from a set of shares.

Installation

To use this package, add the following line to your Julia REPL:

Pkg.add("ShamirSSS")

Usage

Splitting a Secret

To split a secret string into shares, use the split_secret function:

using ShamirSSS

secret = "my_secret_string"
n = 5  # number of shares
t = 3  # threshold required for reconstruction

shares = split_secret(secret, n, t)

This will generate a vector of n shares, each represented as a serialized string.

Reconstructing a Secret

To reconstruct the original secret string from a set of shares, use the reconstruct_secret function:

reconstructed_secret = reconstruct_secret(shares[[5,2,3]])

This will return the original secret string.

Parameters

  • secret: the secret string to be split (required)
  • n: the number of shares to generate (required)
  • t: the minimum number of shares required to reconstruct the secret (required)
  • prime_bits: the number of bits for the prime modulus (optional, default: 4096)

Returns

  • split_secret: a vector of serialized share strings
  • reconstruct_secret: the reconstructed secret string

Example Use Cases

  • Securely sharing a password among multiple team members
  • Distributing a cryptographic key among multiple servers
  • Creating a backup of sensitive data using multiple shares

About

Shamir's Secret Sharing Scheme

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages