deemru / shamir255
Splits sensitive data by Shamir's secret sharing
2.0.1
2025-12-28 22:14 UTC
Requires
- php: >=5.6
This package is auto-updated.
Last update: 2026-02-28 23:06:57 UTC
README
Shamir255 implements Shamir's Secret Sharing algorithm over GF(256).
- Pure PHP implementation (no extensions required)
- Share size equals secret size (efficient storage)
- Supports secrets of any length
- Up to 255 shares with threshold from 2 to 255
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
- PHP >= 5.6
Installation
composer require deemru/shamir255