We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to verify something like this?
PHP
$privkey = "-----BEGIN EC PRIVATE KEY----- MHQCAQEEIElP6IpLbE3Jd7KdBjlHtgtJfcZ94/OEkCoIsl/iV8q8oAcGBSuBBAAK oUQDQgAECQ5QVzipmVe7SUco3rzOgvaO+f70wN5jVVHDK2bSVY1OV3OCW0UZmSjU az/p1DNMYv9tcjPUuPwf+eCtxXSepg== -----END EC PRIVATE KEY----- "; openssl_sign(bin2hex($data), $sign, $privkey, OPENSSL_ALGO_SHA256); $sign = base64_encode($sign);
This always returns false:
Typescript
const data: string = json_response["data"]; const sign64: string = json_response["sign64"]; let EC = require('elliptic').ec; let ec = new EC('secp256k1'); let key = ec.keyFromPublic("04090e505738a99957bb494728debcce82f68ef9fef4c0de635551c32b66d2558d4e5773825b45199928d46b3fe9d4334c62ff6d7233d4b8fc1ff9e0adc5749ea6", 'hex'); let sign = Buffer.from(sign64, "base64").toString("hex"); let datahex = Buffer.from(data, "utf-8").toString("hex"); console.log(key.verify(datahex, sign));
The text was updated successfully, but these errors were encountered:
Update README.md
20395cf
Added note to clarify signed data must be hashed before signature or verification process in response to issue indutny#293 .
I suggested a change to REAME.md. You must hash your data manually.
Sorry, something went wrong.
No branches or pull requests
How to verify something like this?
PHP
This always returns false:
Typescript
The text was updated successfully, but these errors were encountered: