PHPackages                             cline/shamir - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Security](/categories/security)
4. /
5. cline/shamir

ActiveLibrary[Security](/categories/security)

cline/shamir
============

Shamir's Secret Sharing scheme implementation for PHP

2.0.1(2mo ago)01MITPHPPHP ^8.4.0CI passing

Since Mar 4Pushed 2mo agoCompare

[ Source](https://github.com/faustbrian/shamir)[ Packagist](https://packagist.org/packages/cline/shamir)[ RSS](/packages/cline-shamir/feed)WikiDiscussions 2.x Synced 1mo ago

READMEChangelog (1)Dependencies (3)Versions (7)Used By (0)

[![GitHub Workflow Status](https://github.com/faustbrian/shamir/actions/workflows/quality-assurance.yaml/badge.svg)](https://github.com/faustbrian/shamir/actions)[![Latest Version on Packagist](https://camo.githubusercontent.com/55e82501ad47b2746fbe24919a139be8b951680a6d2bedffb17917c9bfeed07f/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f636c696e652f7368616d69722e737667)](https://packagist.org/packages/cline/shamir)[![Software License](https://camo.githubusercontent.com/784362b26e4b3546254f1893e778ba64616e362bd6ac791991d2c9e880a3a64e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4d49542d677265656e2e737667)](LICENSE.md)[![Total Downloads](https://camo.githubusercontent.com/5bebcc4286786b7ca3b36e6a561d012f34c54f88685da6c4d979deaaf431af05/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f636c696e652f7368616d69722e737667)](https://packagist.org/packages/cline/shamir)

---

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
------------

[](#requirements)

> **Requires [PHP 8.4+](https://php.net/releases/)**

Installation
------------

[](#installation)

```
composer require cline/shamir
```

Documentation
-------------

[](#documentation)

Full documentation is available at :

- **[Getting Started](https://docs.cline.sh/shamir/getting-started)** - Installation, basic usage, and quick start
- **[API Reference](https://docs.cline.sh/shamir/api-reference)** - Complete API documentation
- **[Use Cases](https://docs.cline.sh/shamir/use-cases)** - Real-world examples and practical applications
- **[Security](https://docs.cline.sh/shamir/security)** - Security considerations and best practices
- **[Advanced Usage](https://docs.cline.sh/shamir/advanced-usage)** - Advanced patterns and techniques

Quick Example
-------------

[](#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
----------

[](#change-log)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) and [CODE\_OF\_CONDUCT](CODE_OF_CONDUCT.md) for details.

Security
--------

[](#security)

If you discover any security related issues, please use the [GitHub security reporting form](https://github.com/faustbrian/shamir/security) rather than the issue queue.

Credits
-------

[](#credits)

- [Brian Faust](https://github.com/faustbrian)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License. Please see [License File](LICENSE.md) for more information.

###  Health Score

40

—

FairBetter than 88% of packages

Maintenance86

Actively maintained with recent releases

Popularity2

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity56

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~20 days

Total

6

Last Release

64d ago

Major Versions

1.0.2 → 2.0.02026-03-04

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/22145591?v=4)[Brian Faust](/maintainers/faustbrian)[@faustbrian](https://github.com/faustbrian)

---

Top Contributors

[![faustbrian](https://avatars.githubusercontent.com/u/22145591?v=4)](https://github.com/faustbrian "faustbrian (8 commits)")

---

Tags

cryptographyencryptionthresholdshamirkey-managementsecret-sharing

###  Code Quality

TestsPest

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/cline-shamir/health.svg)

```
[![Health](https://phpackages.com/badges/cline-shamir/health.svg)](https://phpackages.com/packages/cline-shamir)
```

###  Alternatives

[phpseclib/phpseclib

PHP Secure Communications Library - Pure-PHP implementations of RSA, AES, SSH2, SFTP, X.509 etc.

5.6k434.8M1.3k](/packages/phpseclib-phpseclib)[defuse/php-encryption

Secure PHP Encryption Library

3.9k162.4M214](/packages/defuse-php-encryption)[paragonie/ciphersweet

Searchable field-level encryption library for relational databases

4641.2M21](/packages/paragonie-ciphersweet)[vlucas/pikirasa

PKI public/private RSA key encryption using the OpenSSL extension

104101.1k1](/packages/vlucas-pikirasa)[ionux/phactor

Phactor is a high-performance PHP implementation of the elliptic curve math functions required to generate &amp; verify private/public (asymmetric) EC keypairs and ECDSA signatures based on secp256k1 curve parameters. This library also includes a class to generate Service Identification Numbers (SINs) based on the published Identity Protocol v1 spec.

5275.0k30](/packages/ionux-phactor)[camcima/dukpt-php

DUKPT implementation in PHP

25153.1k](/packages/camcima-dukpt-php)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
