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

ActiveLibrary[Security](/categories/security)

vascovitche/phpecc
==================

Fork of original PHP Elliptic Curve Cryptography library

v1.0.0(3mo ago)08MITPHPPHP ^7.0||^8.0

Since Mar 13Pushed 3mo agoCompare

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

READMEChangelogDependencies (4)Versions (2)Used By (0)

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

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

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

35

—

LowBetter than 77% of packages

Maintenance80

Actively maintained with recent releases

Popularity4

Limited adoption so far

Community17

Small or concentrated contributor base

Maturity39

Early-stage or recently created project

 Bus Factor1

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

103d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/9d03b6d2705ed26831bc08975550852ccecff441ab18df911b570523f2f4b516?d=identicon)[vascovitche](/maintainers/vascovitche)

---

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)")[![vascovitche](https://avatars.githubusercontent.com/u/28654340?v=4)](https://github.com/vascovitche "vascovitche (3 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/vascovitche-phpecc/health.svg)

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

###  Alternatives

[paragonie/ecc

PHP Elliptic Curve Cryptography library

24772.0k35](/packages/paragonie-ecc)[simplito/elliptic-php

Fast elliptic curve cryptography

2302.4M266](/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.

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

PHP Extension with bindings for bitcoin/secp256k1.

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

Pure PHP secp256k1

40595.2k115](/packages/kornrunner-secp256k1)[acmephp/ssl

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

151.3M4](/packages/acmephp-ssl)

PHPackages © 2026

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