KO
|
EN
gitlite — search
Search
#typescript
#ai-agents
#ai
#dsh-plugin
#deepseek-harness
#open-source
#cli
#claude-code
#codex
#developer-tools
#react
#windows
php-secp256k1
★ 39
Open GitHub ↗
Pure PHP secp256k1
Download README (.md)
Explore Similar Repositories
mikrotik-hotspot-sms
:
No description available.
pimcore2vuestorefront
:
Project has been moved ->
ASDK-Demo
:
Texture(ASDK) - Demo
wxdraw
:
几何画图(微信小程序)
open-solution-value-prediction
:
Open solution to the Santander Value Prediction Challenge :tropical_fish:
// repository documentation
Was this content helpful?
★ 0
(0 ratings)
Select Rating:
★
★
★
★
★
Submit Feedback
Recent Feedback
×
Download README
Do you want to download the
README.md
file for
php-secp256k1
?
Download (.md)
# php-secp256k1 [](https://github.com/kornrunner/php-secp256k1/actions/workflows/tests.yml) [](https://coveralls.io/github/kornrunner/php-secp256k1?branch=master) [](https://packagist.org/packages/kornrunner/secp256k1) ```lang=bash $ composer require kornrunner/secp256k1 ``` ## Usage Sign a message: ```php <?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 <?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 [ 0x9c7b7a00972121fb843af7af74526d7eb585b171][Ethereum] [Ethereum]: https://etherscan.io/address/0x9c7b7a00972121fb843af7af74526d7eb585b171 "Donate with Ethereum"