kornrunner/secp256k1
Composer 安装命令:
composer require kornrunner/secp256k1
包简介
Pure PHP secp256k1
关键字:
README 文档
README
$ composer require kornrunner/secp256k1
Usage
Sign a message:
<?php require_once 'vendor/autoload.php'; use kornrunner\Secp256k1; use kornrunner\Serializer\HexSignatureSerializer; $secp256k1 = new Secp256k1(); // return signature contains r, s and recovery param (v). // message and privateKey are hex strings $signature = $secp256k1->sign($message, $privateKey); // get r $r = $signature->getR(); // get s $s = $signature->getS(); // get recovery param $v = $signature->getRecoveryParam(); // encode to hex $serializer = new HexSignatureSerializer(); $signatureString = $serializer->serialize($signature); // or you can call toHex $signatureString = $signature->toHex();
Verify a message:
<?php require_once 'vendor/autoload.php'; use kornrunner\Secp256k1; $secp256k1 = new Secp256k1(); // signature can be a SignatureInterface object created by sign method // hash and publicKey are hex strings $isVerified = $secp256k1->verify($hash, $signature, $publicKey); // or signature can be a hex string directly $signatureString = 'f67118680df5993e8efca4d3ecc4172ca4ac5e3e007ea774293e37386480970347427f3633371c1a30abbb2b717dbd78ef63d5b19b5a951f9d681cccdd520320'; $isVerified = $secp256k1->verify($hash, $signatureString, $publicKey);
License
MIT
Crypto
kornrunner/secp256k1 适用场景与选型建议
kornrunner/secp256k1 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 613.8k 次下载、GitHub Stars 达 40, 最近一次更新时间为 2018 年 06 月 11 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「elliptic」 「curve」 「ecc」 「secp256k1」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 kornrunner/secp256k1 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 kornrunner/secp256k1 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 kornrunner/secp256k1 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Virgil is a stack of security libraries (ECIES with Crypto Agility wrapped in Virgil Cryptogram) and all the necessary infrastructure to enable seamless, end-to-end encryption for any application, platform or device. See below for currently available languages and platforms. Get in touch with us to
Virgil is a stack of security libraries (ECIES with Crypto Agility wrapped in Virgil Cryptogram) and all the necessary infrastructure to enable seamless, end-to-end encryption for any application, platform or device. See below for currently available languages and platforms. Get in touch with us to
Implementation of raw transactions in bitcoin, HD wallets, Electrum wallets, and other fun stuff.
Fast elliptic curve cryptography
A bundle to calculate normal distribution and other related stuff
Fast elliptic curve cryptography
统计信息
- 总下载量: 613.8k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 40
- 点击次数: 21
- 依赖项目数: 126
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2018-06-11
0x9c7b7a00972121fb843af7af74526d7eb585b171