randrei98/ecdsaphp

Elliptical curve cryptography for PHP

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

This package is auto-updated.

Last update: 2024-05-03 09:11:39 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);