GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
Crypt::SSSS(3) User Contributed Perl Documentation Crypt::SSSS(3)

Crypt::SSSS - implementation of Shamir's Secret Sharing System.

    use Crypt::SSSS;

    # use (3, 3) scheme
    my $shares = ssss_distribute(
        message => "\x06\x1c\x08",
        k       => 3,
    );

    # Save shares
    for my $share (1 .. 3) {
        open my $fh, '>', "share${share}.dat";
        print $fh $shares->{$share}->binary;
        close $fh;
    }

    # Reconstruct message
    my $ishares = {};
    for my $share (1 .. 3) {
        open my $fh, '<', "share${share}.dat";
        $ishares->{$share} = do {
            local $/;    # slurp!
            <$fh>;
        };
        close $fh;
    }

    print "Original message: ", sprintf '"\x%02x\x%02x\x%02x"',
      unpack('C*', ssss_reconstruct(p => 257, shares => $ishares));

Implementation of Shamir's Secret Sharing Scheme.

Crypt::SSSS implements the following attributes.

    my $shares = ssss_distribute(
        message => $message,
        k       => $k,
        p       => $p,         # 257 by default
        n       => $n,         # By default equals to k
    );

Distribute $message to $n shares, so that any $k shares would be enough to reconstruct the secret. $p is a prime number.

Returns hashref of Crypt::SSSS::Message.

    my $secret = ssss_reconstruct(
        shares => $shares,
        p      => $p,        # 257 by default
    );

Reconstruct message from given $shares. $p is a prime number used to distribute message.

Sergey Zasenko, "undef@cpan.org".

Mohammad S Anwar (MANWAR)

Copyright (C) 2011, 2016, Sergey Zasenko.

This program is free software, you can redistribute it and/or modify it under the same terms as Perl 5.10.

2016-01-14 perl v5.32.1

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.