PHPackages                             afk11/ecc - 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. afk11/ecc

ActiveLibrary

afk11/ecc
=========

PHP Elliptic Curve Cryptography library

v0.3.1(11y ago)0281MITPHPPHP &gt;=5.4.0

Since Jul 7Pushed 5y ago1 watchersCompare

[ Source](https://github.com/afk11/phpecc)[ Packagist](https://packagist.org/packages/afk11/ecc)[ Docs](https://github.com/mdanter/phpecc)[ RSS](/packages/afk11-ecc/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependencies (5)Versions (15)Used By (0)

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

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

[![Build Status](https://camo.githubusercontent.com/6a2b063922a281dc37680424b23ce62b0a46b8a085fe10c486ab406ec61f137c/68747470733a2f2f7472617669732d63692e6f72672f7068706563632f7068706563632e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/phpecc/phpecc)

[![Scrutinizer Code Quality](https://camo.githubusercontent.com/7941e4d98207d7568e5912a0a9990c3ae253b1e23ab8c2264b64d3fde2aafaab/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f7068706563632f7068706563632f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/phpecc/phpecc?branch=master)[![Code Coverage](https://camo.githubusercontent.com/e5c5f0068c2d8d771191dfa156e7849f7525b42e7ddf8f63aa2b9ce01a5339b2/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f7068706563632f7068706563632f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/phpecc/phpecc/?branch=master)

[![Latest Stable Version](https://camo.githubusercontent.com/835a6b9022806290819dda9f286818d1bfe4770d317b0bce20c6c67e9ad9fa50/68747470733a2f2f706f7365722e707567782e6f72672f6d64616e7465722f6563632f762f737461626c652e706e67)](https://packagist.org/packages/mdanter/ecc)[![Total Downloads](https://camo.githubusercontent.com/7a6d440f545f1b728e03ee05ed80e50f55707b1f0db6b5e313d00a69934093c0/68747470733a2f2f706f7365722e707567782e6f72672f6d64616e7465722f6563632f646f776e6c6f6164732e706e67)](https://packagist.org/packages/mdanter/ecc)[![Latest Unstable Version](https://camo.githubusercontent.com/d3a98e28f85d926b4bd07460e9fd0c03acec43036d3ab31b776b648e62683b58/68747470733a2f2f706f7365722e707567782e6f72672f6d64616e7465722f6563632f762f756e737461626c652e706e67)](https://packagist.org/packages/mdanter/ecc)[![License](https://camo.githubusercontent.com/38b47d81c8f5b32ccaef6289bb927fa12d1fd02f249355919ff65f41017dc92e/68747470733a2f2f706f7365722e707567782e6f72672f6d64616e7465722f6563632f6c6963656e73652e706e67)](https://packagist.org/packages/mdanter/ecc)

### Information

[](#information)

This library is a rewrite/update of Matyas Danter's ECC library. All credit goes to him.

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 mdanter/ecc:^1.0`

### 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/phpecc/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

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community18

Small or concentrated contributor base

Maturity56

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 63% 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 ~0 days

Total

4

Last Release

4329d ago

PHP version history (2 changes)0.2.0PHP &gt;=5.3.3

0.3.x-devPHP &gt;=5.4.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/763cdc5cc50414bacd4ff1080eede79432f7c3cc26a3d8aa9031b1537a8bd734?d=identicon)[thomaskerin](/maintainers/thomaskerin)

---

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)")[![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)")[![xsilen-tt](https://avatars.githubusercontent.com/u/90232688?v=4)](https://github.com/xsilen-tt "xsilen-tt (2 commits)")[![johanderuijter](https://avatars.githubusercontent.com/u/1373219?v=4)](https://github.com/johanderuijter "johanderuijter (2 commits)")[![aztech-dev](https://avatars.githubusercontent.com/u/93562568?v=4)](https://github.com/aztech-dev "aztech-dev (2 commits)")[![scrutinizer-auto-fixer](https://avatars.githubusercontent.com/u/6253494?v=4)](https://github.com/scrutinizer-auto-fixer "scrutinizer-auto-fixer (1 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)")

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/afk11-ecc/health.svg)

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

###  Alternatives

[phan/phan

A static analyzer for PHP

5.6k11.2M1.1k](/packages/phan-phan)[illuminate/console

The Illuminate Console package.

12944.1M5.1k](/packages/illuminate-console)[php-soap/wsdl

Deals with WSDLs

173.5M12](/packages/php-soap-wsdl)[php-soap/wsdl-reader

A WSDL reader in PHP

212.3M9](/packages/php-soap-wsdl-reader)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

245.2k](/packages/aedart-athenaeum)

PHPackages © 2026

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