Curve25519 extension for PHP
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
bin binaries Jan 13, 2016
curve Update curve_sigs.h Jun 24, 2016
LICENSE LICENSE Mar 10, 2016
README.md Update README.md Mar 10, 2016
config.m4 First version Sep 10, 2015
curve.c PHP7 Compatibility Apr 14, 2016
php_curve25519.h PHP7 Compatibility Apr 14, 2016

README.md

curve25519 php

Curve25519 library with Ed25519 signatures extension for PHP. This is used in Chat API

$secureRandom = self::getSecureRandom();
$private = curve25519_private($secureRandom);
$public  = curve25519_public($private);
$keyPair = new ECKeyPair(new DjbECPublicKey($public),new DjbECPrivateKey($private));
        
$agreement = curve25519_shared( $keyPair->getPrivateKey(),$keyPair->getPublicKey());
$signature = curve25519_sign(getSecureRandom(64), $signingKey->getPrivateKey(), $message);
$verified  = curve25519_verify($signingKey->getPublicKey(), $message, $signature) == 0;

Installation

Linux and OS X

phpize
./configure
make
sudo make install

License

MIT