Download the PHP package starkbank/ecdsa without Composer

On this page you can find all versions of the php package starkbank/ecdsa. 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 ecdsa

A lightweight and fast pure PHP ECDSA

Overview

This is a pure PHP implementation of the Elliptic Curve Digital Signature Algorithm. It is compatible with OpenSSL and uses elegant math such as Jacobian Coordinates to speed up the ECDSA on pure PHP.

Security

starkbank-ecdsa includes the following security features:

Installation

Composer

To install the package with Composer, run:

To use the bindings, use Composer's autoload:

External dependencies

The package makes use of the 'GNU Multiple Precision' (GMP) library. For installation details, see: https://www.php.net/manual/en/gmp.installation.php

Curves

We currently support secp256k1 and prime256v1 (P-256), but you can add more curves to the project. You just need to use the CurveFp::add() method.

Speed

We ran a test on a MAC Pro using PHP 8.5. The library was run 100 times and the averages displayed below were obtained:

Library sign verify
starkbank-ecdsa 0.3ms 0.8ms

Performance is driven by Jacobian coordinates, a branch-balanced Montgomery ladder for variable-base scalar multiplication, a precomputed affine table of powers-of-two multiples of the generator ([G, 2G, 4G, ..., 2^n*G]) combined with a width-2 NAF of the scalar to eliminate doublings during signing, a mixed affine+Jacobian addition fast path, curve-specific shortcuts in point doubling (A=0 for secp256k1, A=-3 for prime256v1), the secp256k1 GLV endomorphism to split 256-bit scalars into two ~128-bit halves for a 4-scalar simultaneous multi-exponentiation during verification, Shamir's trick with Joint Sparse Form as the fallback path for curves without an efficient endomorphism, and the extended Euclidean algorithm for modular inversion.

Sample Code

How to sign a json message for Stark Bank:

Simple use:

How to add more curves:

How to generate a compressed public key:

How to recover a compressed public key:

OpenSSL

This library is compatible with OpenSSL, so you can use it to generate keys:

Create a message.txt file and sign it:

It's time to verify:

You can also verify it on terminal:

NOTE: If you want to create a Digital Signature to use in the Stark Bank, you need to convert the binary signature to base64.

You can also verify it with this library:

Run all unit tests

Run benchmark


All versions of ecdsa with dependencies

PHP Build Version
Package Version
Requires php Version >=7.0
ext-gmp Version *
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 starkbank/ecdsa contains the following files

Loading the files please wait ...