Shamir PHP implementation
- PHP 7.4 or higher.
The package could be installed with composer:
composer require unitpay/shamir --prefer-dist
Split secret to parts with threshold
$secret = 'Some super secret'; $parts = 5; $threshold = 3; $shares = Shamir::split($secret, $parts, $threshold);
$recoveredSecret = Shamir::reconstruct([$parts, $parts, $parts]);
The package is tested with PHPUnit. To run tests:
The code is statically analyzed with Psalm. To run static analysis:
It is released under the terms of the MIT License.
LICENSE for more information.