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.
Download starkbank/ecdsa
More information about starkbank/ecdsa
Files in starkbank/ecdsa
Package ecdsa
Short Description fast openSSL-compatible implementation of the Elliptic Curve Digital Signature Algorithm (ECDSA)
License MIT
Homepage https://github.com/starkbank/ecdsa-php
Informations about the package ecdsa
A lightweight and fast 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 spped up the ECDSA on pure PHP.
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
, but you can add more curves to your project. You just need to use the Curve::add()
method.
Speed
We ran a test on a Macbook Air M1 2020 using PHP 8.1. We ran the library 100 times and got the average time displayed bellow:
Library | sign | verify |
---|---|---|
starkbank-ecdsa | 1.9ms | 3.7ms |
Sample Code
How to sign a json message for Stark Bank:
Simple use:
How to add more curves:
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
All versions of ecdsa with dependencies
ext-gmp Version *