Questions tagged [secp256k1]

Secp256k1 is the name of the elliptic curve used by Bitcoin to implement its public key cryptography.

60 questions
0
votes
1 answer

ECDSA signature verification mismatch

I see a strange behaviour on ECDSA signature verification from the nodejs's secp256k1 package that sometimes fails the signature check. I use the following public key: 33 2E 16 0F 4C 24 1F 50 0B 5A 67 13 EB E1 52 52 D1 E2 BA A0 0A B9 7B 54 6E 5C CD…
Fabio Angeletti
  • 311
  • 3
  • 12
0
votes
0 answers

C++ - OpenSSL secp256k1 ECDSA - Can't verify using exact copy of hash, whether using string literals or different objects

I am trying to sign a hash, create a copy of that hash (specifically client/server related), then verify the signature using the copy of the hash. I don't understand how or why when I have two variables, hash and hashCopy, with the exact same…
0
votes
0 answers

C++ - OpenSSL - secp256k1 Keypair test not working on website - also unsure how to sign and verify using a string

I have the following code for printing and generating a public and private key: #include #include #include int main() { BIO* outbio = NULL; EC_KEY* myecc = NULL; EVP_PKEY* pkey = NULL; …
user5057712
0
votes
1 answer

Why do I get "PrehashSignature is not implemented for Signature" error when using k256 library?

I simply tried to create a recoverable signature using the k256 crate documentation as a reference as follows, but for some reason I get a compile error regarding the sign method to create the signature. use k256::ecdsa::{recoverable,…
user76333
  • 153
  • 1
  • 13
0
votes
1 answer

Elliptic Curve DSA in Bouncy Castle - what do h and n stand for?

I am trying to re-construct an ECPublicKey (generated by a smart card) in java with BouncyCastle. I have this code, found from an example online: KeyFactory keyFact = KeyFactory.getInstance("EC"); ECNamedCurveParameterSpec paramSpec =…
0
votes
0 answers

secp256k1 private key save to pem file

Hi I am doing the save private key of secp256k1 to pem file with Swift. As I generate the private key, I got a 32 bytes key, somehow in base64 it is "7vInO7T/GBg6bxkr+6W4ESV4UOy6W4E2N4i9fBgMqYM=" which is a quite short string. I see some example of…
0
votes
0 answers

How to generate secp256k1 signature using private key in HEX format

I am trying to sign the short message using the PostingKey from the Hive network. I am trying to use BouncyCastle but I am not able to initialise its signer, my (not so good code) look like that: public static class Signer { public…
Assassin
  • 1,296
  • 2
  • 14
  • 17
0
votes
1 answer

Azure KeyVault signature fails during verification using javascript libraries intermittently

I am using Azure key vault for creating and storing my Secp256k1 keys. I am also using the sign API for getting my input string signed. I am working on a Secp256K1 blockchain network.These are steps I follow to get the signature in…
0
votes
0 answers

Secp256k1 Public key generated with Azure Key Vault is of 43 characters

I am using Azure key vault for a pet project and I am creating Secp256k1 key pair. Steps to create the key in Azure: Open your Key Vault resource Choose Keys from the left side panel. Click Generate/Import from the top left corner. Chose Key Type:…
0
votes
0 answers

Trouble installing libbitcoin-system library

I´m trying to follow along the book from Andreas Antonopolus (Mastering bitcoin) and I would want to do everything in the book, so Im stuck with this: trying to install the bitcoin explorer command line tool, I realized that I needed to install the…
0
votes
2 answers

How do I reverse a hex string?

Given a hex string, such as "d59c168e05df4757", how can I reverse the bytes of this string, so as to read [57, 47, df, 05, 8e, 16, 9c, d5]? Using the as_bytes() method converts each individual character into a byte value, rather than the…
Isambard_FA
  • 97
  • 13
0
votes
0 answers

Eccrypto ECIES Decrypt Scheme, JavaScript

This will probably need some sort of background in https://www.npmjs.com/package/eccrypto . I am trying to decrypt a message that was retrieved from an api with the ECIES scheme but it keeps telling me that the public key is "bad". error: Uncaught…
user14930609
0
votes
1 answer

How can this section of Discrete logarithm problem in ECDSA be sorted out/implemented

In the discrete logarithm problem of the secp256k1 curve, I'm actually curious as to how the generator point and the public key would be implemented (on the grounds that there are two versions of the parameters). I was wondering if the Public key…
-2
votes
1 answer

Failed to compile with secp256k1 library

So I was following this tutorial: https://nickfarrow.com/Cryptography-in-Bitcoin-with-C/ I installed libsecp256k1 from https://www.howtoinstall.me/ubuntu/18-04/libsecp256k1-dev/ but while compiling my program: #include #include…
1 2 3
4