Download the PHP package paragonie/ecc without Composer

On this page you can find all versions of the php package paragonie/ecc. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package ecc

Pure PHP Elliptic Curve DSA and DH

Build Status Type Safety

Scrutinizer Code Quality Code Coverage

Latest Stable Version Total Downloads Latest Unstable Version License

Notice

This library is a fork from phpecc/phpecc, which is itself a fork of mdanter/ecc. It should serve as a drop-in replacement for any applications that previously depended on either method.

Security Information

By default, this library will attempt to use OpenSSL's implementation first. This requires PHP 8.1+ and OpenSSL 3.0+ to work. OpenSSL's implementation should be constant-time.

When OpenSSL is not available, this library will back to a Pure PHP implementation. There are actually two implementations:

  1. An optimized constant-time implementation of each elliptic curve.
  2. A generic elliptic curve algorithm that was shipped with the original PHP ECC library.

We have taken every effort to harden our fork of this library against side-channel attacks in the "optimized" code.

We cannot guarantee that the generic elliptic curve code is constant-time. We instead urge users to use either OpenSSL's implementation or our constant-time implementation.

This Library Implements Low-Level Elliptic Curve Cryptography

If you just need Diffie-Hellman or ECDSA, you should install EasyECC instead of working with this library directly. EasyECC was designed to use PHPECC in a secure-by-default manner.

Historical Information

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

The library supports the following curves:

Additionally, the following curves are also provided if, and only if, you enable insecure curves:

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.

However, it's actually even worse than a simple "reuse" concern. Even if you never reuse a k value, if you have any bias in the distribution of bits in k, an attacker that observes sufficient signatures can use Lattice Reduction to recover your key.

The HMAC random generator can derive a deterministic k value from the message hash and private key. This provides an unbiased distribution of bits, and is therefore suitable for addressing this concern.

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

The "optimized" constant-time code uses Complete addition formulas for prime order elliptic curves to avoid side-channels with point addition and point doubling.

License

This package is released under the MIT license.

Requirements

Installation

You can install this library via Composer :

composer require paragonie/ecc:^2

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 for your pull requests.

Usage

Examples:

Insecure Curves

The EccFactory class will, by default, only allow you to instantiate secure elliptic curves. An elliptic curve is considered secure if one or more of the following is true:

  1. If we can depend on OpenSSL to provide its implementation, we will. This is considered secure.
  2. If we have an optimized constant-time implementation, it is secure.
  3. If the elliptic curve discrete logarithm problem (ECDLP) for the curve has a security level in equivalent to less than 120 bits, it is considered insecure. (We do not provide constant-time implementations for these curves, so step 2 should already fail these curves.)
  4. Otherwise, it is considered insecure. EccFactory will not allow them by default.

To bypass this guard-rail, simply pass true to the second argument, like so:


All versions of ecc with dependencies

PHP Build Version
Package Version
Requires php Version ^7.1||^8.0
paragonie/sodium_compat Version ^1|^2
ext-gmp Version *
genkgo/php-asn1 Version ^2
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package paragonie/ecc contains the following files

Loading the files please wait ....