PHP ECC Class Library

This is a very simple frontend to Matyas Danter's phpecc libraries for the EC algorithm. Still under active development. Currently it generates an EC keypair, and can generate a public key from a given private key.

Requirements

  • PHP 5.3 or later
  • GMP or BCMATH Extension

How to Use

The library is very simple at the moment and offers just private and public key generation. Future revisions will include message signing and verification.

Generate a new keypair:

//Use base 256
define('MAX_BASE', 256);

include 'autoload.inc.php';
include 'classes/PHPECC.class.php';
include 'classes/SECurve.class.php';

$keypair = PHPECC::hex_keypair_genorate();

print_r($keypair);

Generate a new private key only:

echo $pKey = PHPECC::hex_private_key_genorate();

Get the public key from the private key

echo $pubKey = PHPECC::hex_private_key_to_hex_public_key($pKey);

Download

The latest version can be obtained from GitHub:

https://github.com/tuaris/PHPECC

If you find this useful:
BTC: 1B6eyXVRPxdEitW5vWrUnzzXUy6o38P9wN
ZET: ZK6kdE5H5q7H6QRNRAuqLF6RrVD4cFbiNX

Pacy
Powered by Pacy