cline / shamir
Shamir's Secret Sharing scheme implementation for PHP
Installs: 0
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 0
Open Issues: 0
pkg:composer/cline/shamir
Requires
- php: ^8.4.0
- ext-gmp: *
Requires (Dev)
- cline/coding-standard: ^1.5.8
- pestphp/pest: ^4.1.6
- phpstan/phpstan: ^2.1.33
README
A pure PHP implementation of Shamir's Secret Sharing scheme with fluent conductor API, allowing secrets to be split into N shares where any M shares can reconstruct the original secret. Features zero external dependencies, information-theoretic security, and automatic chunking for large secrets.
Requirements
Requires PHP 8.4+
Installation
composer require cline/shamir
Documentation
Full documentation is available at https://docs.cline.sh/shamir:
- Getting Started - Installation, basic usage, and quick start
- API Reference - Complete API documentation
- Use Cases - Real-world examples and practical applications
- Security - Security considerations and best practices
- Advanced Usage - Advanced patterns and techniques
Quick Example
use Cline\Shamir\Shamir; // Split a secret into 5 shares, requiring 3 to reconstruct $shares = Shamir::for('my-encryption-key') ->threshold(3) ->shares(5) ->split(); // Reconstruct from any 3 shares $secret = Shamir::from($shares->take(3))->combine();
Change log
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING and CODE_OF_CONDUCT for details.
Security
If you discover any security related issues, please use the GitHub security reporting form rather than the issue queue.
Credits
License
The MIT License. Please see License File for more information.