deemru/curve25519
Composer 安装命令:
composer require deemru/curve25519
包简介
Curve25519 sign/verify
README 文档
README
Curve25519 implements the missing functionality of sign/verify on elliptic curve 25519.
- Cryptographically compatible sign/verify
- Built in cache for last key calculations
- Sodium variant of the sign function (~2000x faster)
Usage
$curve25519 = new Curve25519(); $msg = 'Hello, world!'; $privateKey = random_bytes( 32 ); $sig = $curve25519->sign( $msg, $privateKey ); $publicKey = $curve25519->getPublicKeyFromPrivateKey( $privateKey ); $verify = $curve25519->verify( $sig, $msg, $publicKey ); if( !$verify ) exit( 1 );
Requirements
- PHP >= 5.6
Recommended
Installation
Require through Composer:
{
"require": {
"deemru/curve25519": "1.0.*"
}
}
Notice
sign_sodiumhashes private key internally by SHA-512- Beware of
rseedfunctionality (for experts only) - Consider to use ED25519_NO_SHA512SK sodium build
统计信息
- 总下载量: 40.76k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 12
- 点击次数: 0
- 依赖项目数: 3
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2019-01-12