A Julia package implementing Shamir's Secret Sharing Scheme.
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.
To use this package, add the following line to your Julia REPL:
Pkg.add("ShamirSSS")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.
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.
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)
split_secret: a vector of serialized share stringsreconstruct_secret: the reconstructed secret string
- Securely sharing a password among multiple team members
- Distributing a cryptographic key among multiple servers
- Creating a backup of sensitive data using multiple shares