2 A libary for sharing secrets in an information-theoretically secure way.
3 It uses Shamir's secret sharing to enable sharing a (random) secret between
4 n persons where k <= n persons are enough to recover the secret. k-1 secret
5 share holders learn nothing about the secret when they combine their shares.
7 This library is based on the OpenXPKI::Crypto::Secret::Split Perl module used
8 in the open source PKI software OpenXPKI, which was written by Alexander Klink
9 for the OpenXPKI project in 2006.
12 This package requires Ruby 1.8 or later.
14 == Installation instructions
16 rake install (non-gem) or rake install_gem (gem)
19 require 'secretsharing'
21 # create an object for 3 out of 5 secret sharing
22 s = SecretSharing::Shamir.new(5,3)
24 # create a random secret (returns the secret)
25 s.create_random_secret()
31 s.shares.each { |share| puts share }
33 # recover secret from shares
35 s2 = SecretSharing::Shamir.new(3)
36 # accepts SecretSharing::Shamir::Share objects or
37 # string representations thereof
44 Add support for using your own instead of a random secret.
47 (c) 2010 Alexander Klink
50 Licensed under the Apache License, Version 2.0 (the "License");
51 you may not use this file except in compliance with the License.
52 You may obtain a copy of the License at
54 http://www.apache.org/licenses/LICENSE-2.0
57 Unless required by applicable law or agreed to in writing, software
58 distributed under the License is distributed on an "AS IS" BASIS,
59 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
60 See the License for the specific language governing permissions and
61 limitations under the License.
65 secretsharing@alech.de