deemru/shamir255

Splits sensitive data by Shamir's secret sharing

1.0.0 2025-03-02 19:45 UTC

This package is auto-updated.

Last update: 2025-03-31 10:40:35 UTC


README

packagist php-v GitHub license

Shamir255 implements Shamir's secret sharing algorithm for sensitive information up to 255 bytes via 2048-bit MODP group.

Usage

$sensitive = 'Hello, world!';
$needed = 2;
$total = 3;
$shares = Shamir255::share( $sensitive, $needed, $total );
assert( $sensitive === Shamir255::recover( [ 1 => $shares[1], 2 => $shares[2] ] ) );

Requirements

Installation

composer require deemru/shamir255