PHPackages                             shanecurran/phpecc - 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. shanecurran/phpecc

ActiveLibrary[Security](/categories/security)

shanecurran/phpecc
==================

PHP Elliptic Curve Cryptography library

v0.0.1(3y ago)0166.4k↓52.8%1[1 PRs](https://github.com/shanecurran/phpecc/pulls)4MITPHPPHP ^7.0||^8.0

Since Mar 8Pushed 3y agoCompare

[ Source](https://github.com/shanecurran/phpecc)[ Packagist](https://packagist.org/packages/shanecurran/phpecc)[ Docs](https://github.com/shanecurran/phpecc)[ RSS](/packages/shanecurran-phpecc/feed)WikiDiscussions master Synced 3d ago

READMEChangelog (1)Dependencies (4)Versions (2)Used By (4)

Pure PHP Elliptic Curve DSA and DH
----------------------------------

[](#pure-php-elliptic-curve-dsa-and-dh)

[![Scrutinizer Code Quality](https://camo.githubusercontent.com/dc9ebf59e1fb8f2a850b947d84e4603df6038199ff29a190c514b8f63843037e/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f7368616e6563757272616e2f7068706563632f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/shanecurran/phpecc?branch=master)[![Code Coverage](https://camo.githubusercontent.com/233621e7922ca2372bbdd7710718c0e78688835cfe32b00c4e47a117bcd9702b/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f7368616e6563757272616e2f7068706563632f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/shanecurran/phpecc/?branch=master)

[![Latest Stable Version](https://camo.githubusercontent.com/5868dc57aa85294e24f526ee24605eacf99d01a79c6d37cc62fa632340c0f88e/68747470733a2f2f706f7365722e707567782e6f72672f7368616e6563757272616e2f7068706563632f762f737461626c652e706e67)](https://packagist.org/packages/shanecurran/phpecc)[![Total Downloads](https://camo.githubusercontent.com/bd2c41fba4949a6560de1f3367d31cb553c8e6d648df5234f031790da13b6ead/68747470733a2f2f706f7365722e707567782e6f72672f7368616e6563757272616e2f7068706563632f646f776e6c6f6164732e706e67)](https://packagist.org/packages/shanecurran/phpecc)[![Latest Unstable Version](https://camo.githubusercontent.com/e2e25d4c1e33778295b62fd7fb40b25aca992ed4af72d1a148dea68fe1faa3ae/68747470733a2f2f706f7365722e707567782e6f72672f7368616e6563757272616e2f7068706563632f762f756e737461626c652e706e67)](https://packagist.org/packages/shanecurran/phpecc)[![License](https://camo.githubusercontent.com/26199d7ac88b2c0dea92de90ac17e27eb9d537b158f5cc3bab0be487637a84a8/68747470733a2f2f706f7365722e707567782e6f72672f7368616e6563757272616e2f7068706563632f6c6963656e73652e706e67)](https://packagist.org/packages/shanecurran/phpecc)

### Information

[](#information)

This library is an actively maintained fork of Thomas Kerin's [`phpecc`](https://github.com/phpecc/phpecc) library, which is a rewrite/update of Matyas Danter's ECC library. All credit goes to them.

For more information on Elliptic Curve Cryptography please read [this fine article](http://www.matyasdanter.com/2010/12/elliptic-curve-php-oop-dsa-and-diffie-hellman/).

The library supports the following curves:

- secp112r1
- secp256k1
- nistp192
- nistp224
- nistp256 / secp256r1
- nistp384 / secp384r1
- nistp521

During ECDSA, a random value `k` is required. It is acceptable to use a true RNG to generate this value, but should the same `k` value ever be repeatedly used for a key, an attacker can recover that signing key. The HMAC random generator can derive a deterministic k value from the message hash and private key, voiding this concern.

The library uses a non-branching Montgomery ladder for scalar multiplication, as it's constant time and avoids secret dependant branches.

### License

[](#license)

This package is released under the MIT license.

### Requirements

[](#requirements)

- PHP 7.0+ or PHP 8.0+
- composer
- ext-gmp

Support for older PHP versions:

- v0.4.x: php ^5.6|&lt;7.2
- v0.5.x: php ^7.0
- v1.0.x: php ^7.0|^8.0

### Installation

[](#installation)

You can install this library via Composer :

`composer require shanecurran/phpecc`

### Contribute

[](#contribute)

When sending in pull requests, please make sure to run the `make` command.

The default target runs all PHPUnit and PHPCS tests. All tests must validate for your contribution to be accepted.

It's also always a good idea to check the results of the [Scrutinizer analysis](https://scrutinizer-ci.com/g/shanecurran/phpecc/) for your pull requests.

### Usage

[](#usage)

Examples:

- [Key generation](./examples/key_generation.php)
- [ECDH exchange](./examples/ecdh_exchange.php)
- [Signature creation](./examples/creating_signature.php)
- [Signature verification](./examples/verify_signature.php)

###  Health Score

31

—

LowBetter than 66% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity33

Limited adoption so far

Community24

Small or concentrated contributor base

Maturity40

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 61.9% 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

Unknown

Total

1

Last Release

1214d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/108f243f086809cd231a3c0fe9ddfdb7e8f6c4434e9252a97aad23878ba548c8?d=identicon)[shanecurran](/maintainers/shanecurran)

---

Top Contributors

[![afk11](https://avatars.githubusercontent.com/u/5617245?v=4)](https://github.com/afk11 "afk11 (174 commits)")[![btcdrak](https://avatars.githubusercontent.com/u/7275704?v=4)](https://github.com/btcdrak "btcdrak (47 commits)")[![rubensayshi](https://avatars.githubusercontent.com/u/649160?v=4)](https://github.com/rubensayshi "rubensayshi (14 commits)")[![mdanter](https://avatars.githubusercontent.com/u/2213324?v=4)](https://github.com/mdanter "mdanter (8 commits)")[![fgrosse](https://avatars.githubusercontent.com/u/733004?v=4)](https://github.com/fgrosse "fgrosse (6 commits)")[![kornrunner](https://avatars.githubusercontent.com/u/725986?v=4)](https://github.com/kornrunner "kornrunner (6 commits)")[![shanecurran](https://avatars.githubusercontent.com/u/968388?v=4)](https://github.com/shanecurran "shanecurran (5 commits)")[![Spomky](https://avatars.githubusercontent.com/u/1091072?v=4)](https://github.com/Spomky "Spomky (4 commits)")[![scintill](https://avatars.githubusercontent.com/u/848492?v=4)](https://github.com/scintill "scintill (2 commits)")[![aztech-dev](https://avatars.githubusercontent.com/u/93562568?v=4)](https://github.com/aztech-dev "aztech-dev (2 commits)")[![johanderuijter](https://avatars.githubusercontent.com/u/1373219?v=4)](https://github.com/johanderuijter "johanderuijter (2 commits)")[![xsilen-tt](https://avatars.githubusercontent.com/u/90232688?v=4)](https://github.com/xsilen-tt "xsilen-tt (2 commits)")[![staabm](https://avatars.githubusercontent.com/u/120441?v=4)](https://github.com/staabm "staabm (1 commits)")[![paragonie-security](https://avatars.githubusercontent.com/u/15914520?v=4)](https://github.com/paragonie-security "paragonie-security (1 commits)")[![makuser](https://avatars.githubusercontent.com/u/1778889?v=4)](https://github.com/makuser "makuser (1 commits)")[![mdance](https://avatars.githubusercontent.com/u/121057?v=4)](https://github.com/mdance "mdance (1 commits)")[![carusogabriel](https://avatars.githubusercontent.com/u/16328050?v=4)](https://github.com/carusogabriel "carusogabriel (1 commits)")[![paragonie-scott](https://avatars.githubusercontent.com/u/11591518?v=4)](https://github.com/paragonie-scott "paragonie-scott (1 commits)")[![dktapps](https://avatars.githubusercontent.com/u/14214667?v=4)](https://github.com/dktapps "dktapps (1 commits)")[![rgex](https://avatars.githubusercontent.com/u/3996942?v=4)](https://github.com/rgex "rgex (1 commits)")

---

Tags

ecdhECDSAellipticcurvesecp256k1nistp192nistp224nistp256nistp521nistp384DiffieHellmanphpeccsecp256r1

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/shanecurran-phpecc/health.svg)

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

###  Alternatives

[paragonie/ecc

PHP Elliptic Curve Cryptography library

24820.0k38](/packages/paragonie-ecc)[simplito/elliptic-php

Fast elliptic curve cryptography

2302.4M272](/packages/simplito-elliptic-php)[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.

5287.3k30](/packages/ionux-phactor)[bitwasp/secp256k1-php

PHP Extension with bindings for bitcoin/secp256k1.

58190.4k36](/packages/bitwasp-secp256k1-php)[kornrunner/secp256k1

Pure PHP secp256k1

40609.0k117](/packages/kornrunner-secp256k1)[acmephp/ssl

PHP wrapper around OpenSSL extension providing SSL encoding, decoding, parsing and signing features

151.4M4](/packages/acmephp-ssl)

PHPackages © 2026

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