description | Shamir Secret Sharing Ruby gem |
repository URL | git://git.alech.de/secretsharing |
owner | git@alech.de |
last change | Mon, 27 Jun 2011 09:04:09 +0000 (27 11:04 +0200) |
last refresh | Wed, 25 May 2016 18:43:01 +0000 (25 20:43 +0200) |
mirror URL | git://repo.or.cz/secretsharing.git |
| https://repo.or.cz/secretsharing.git |
| ssh://git@repo.or.cz/secretsharing.git |
bundle info | secretsharing.git downloadable bundles |
content tags
|
|
README
== Description
A libary for sharing secrets in an information-theoretically secure way.
It uses Shamir's secret sharing to enable sharing a (random) secret between
n persons where k <= n persons are enough to recover the secret. k-1 secret
share holders learn nothing about the secret when they combine their shares.
This library is based on the OpenXPKI::Crypto::Secret::Split Perl module used
in the open source PKI software OpenXPKI, which was written by Alexander Klink
for the OpenXPKI project in 2006.
== Prerequisites
This package requires Ruby 1.8 or later.
== Installation instructions
rake test (optional)
rake install (non-gem) or rake install_gem (gem)
== Synopsis
require 'secretsharing'
# create an object for 3 out of 5 secret sharing
s = SecretSharing::Shamir.new(5,3)
# create a random secret (returns the secret)
s.create_random_secret()
# show secret
puts s.secret
# show password representation of secret (Base64)
puts s.secret_password
# show shares
s.shares.each { |share| puts share }
# recover secret from shares
s2 = SecretSharing::Shamir.new(3)
# accepts SecretSharing::Shamir::Share objects or
# string representations thereof
s2 << s.shares[0]
s2 << s.shares[2]
s2 << s.shares[4]
puts s2.secret
== Copyright
(c) 2010-2011 Alexander Klink
== License
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
== Warranty
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
== Author
Alexander Klink
secretsharing@alech.de
http://www.alech.de
@alech on Twitter