Skip to content

josiahking/curve25519-php

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Curve25519 extension for PHP

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C 98.9%
  • C++ 1.1%