randrei98/ecdsaphp

Elliptical curve cryptography for PHP

V2.1.2 2023-07-09 23:25 UTC

This package is auto-updated.

Last update: 2024-11-03 10:09:19 UTC


README

Elliptic Curve Cryptography for PHP

##Usage

use \ECDSA\Key;
use \ECDSA\Curves;
use \ECDSA\Algorithms;
use \ECDSA\ECDSA;

$pem = 'EC PRIVATE KEY PEM FORMAT';

$curve = Curves::NIST256p();
$algorithm = Algorithms::ES256();

$key = new Key($pem, '', $curve, $algorithm);

$message = 'HELLO';

$Signature = ECDSA::Sign($message, $key);

$verif = ECDSA::Verify($message, $Signature, $key);

var_dump($verif);