Questions tagged [elliptic-curve]

In mathematics, an elliptic curve is a smooth, projective algebraic curve of genus one, on which there is a specified point O.

Filter by
Sorted by
Tagged with
1 vote
1 answer
36 views

Problem with the out put of the ecc_decryption_key using libtomcrypt in C

I Have the following simple code. Im just initializing the parameters, calling a make_key function, encrypting the data and trying to decrypted the data #define LTM_DESC #include <tomcrypt.h> ...
Breno Marot's user avatar
1 vote
0 answers
20 views

Why Does Iden3 Use 253-bit Slots for Claims

I'm exploring the Iden3 protocol, and I noticed that Iden3 designs its claim slots to be 253 bits in size, rather than the more common 256-bit size. I'm curious about the specific reasoning behind ...
SinTan1071's user avatar
0 votes
0 answers
41 views

How do I get the common secret for numbers that are less than modulo in the modulo function?

I am trying to implement something similar to the Diffie-Hellman encryption algorithm on elliptic curves, my curve has parameters a = 0, b = 7, p = ...
moonkush's user avatar
1 vote
1 answer
69 views

Complete integral of the third kind using scipy/python and mathematica

I recently came to an issue which requires using the complete elliptical integral of the third kind. It was written as a single fuction in the form of PI(m,n). Honestly I am not familiar with this ...
yangyang's user avatar
  • 149
0 votes
0 answers
33 views

changing the mod in secp256k1

Guys not very great at math, but i am trying to achieve something, well firstly i understand that secp256k1 has a large prime modulo. now i have figured out a way to perform a division like operation ...
Melwyn's user avatar
  • 1
0 votes
1 answer
47 views

AES-256-GCM decryption failure with AES.GCM.open in Swift

Quick background: I want the server to encrypt a small payload of data using public keys provided by clients so that the clients can decrypt it and the server doesn't have to store the sensitive data. ...
mroach's user avatar
  • 2,403
0 votes
1 answer
137 views

Convert X25519 to Ed25519 in curve25519-dalek

For a scenario in which only an X25519 keypair is available but I need to create and verify a signature with what I have, I am trying to convert an X25519 public key into an Ed25519 verification key ...
Dominik George's user avatar
0 votes
1 answer
59 views

crypto.subtle.sign() doesn't seem to be doing any signing?

My code: /* Fetch the contents of the "message" textbox, and encode it in a form we can use for the sign operation. */ function getMessageEncoding() { const messageBox = 'hello world!'; ...
neubert's user avatar
  • 16.1k
1 vote
0 answers
59 views

Issue with implementing X25519 from RFC 7748

https://www.rfc-editor.org/rfc/rfc7748 gives a simple implementation of scalar multiplication on curve25519. They have some Python code and some pseudocode, and I tried my best to connect all of it ...
Miodek's user avatar
  • 55
0 votes
0 answers
47 views

ECDSA function in C not giving the correct signature

I have written this C code for creating an es384 signature with sha 384 which I will base 64 encode and use to create a JWT. But for some reason, the signature is not correct and I have no clue why #...
Ajith Nair's user avatar
0 votes
0 answers
42 views

How to use ECDsa

I'm creating a tool that generates EC key pair. I'm new to the Elliptic Curve Algorithm. I started with this function: public static void GenerateECPublicKey(byte[] p, byte[] g, byte[] a, byte[] b, ...
jmt's user avatar
  • 1
1 vote
0 answers
57 views

CNG: Get an ECC Private key blob in pkcs8 format with explicit domain parameters

I want to save an ECC Prvivate key in PKCS8 format but with explicit domain parameters instead of named curve parameters, which is what the code below does. CNG seems to give me the option of ...
tzippy's user avatar
  • 6,518
0 votes
0 answers
145 views

Algorithm for dividing a point of an elliptic curve by a number (scalar)

How to implement an algorithm for dividing by the number Z (scalar) of a point lying on an elliptic curve? Curve like: y^2 = x^3 + A * x + B A, B and the number Z are known. The point is arbitrary, ...
manu's user avatar
  • 21
1 vote
1 answer
262 views

Compress secp256k1 elliptic curve x, y coordinates strings strings into hex public key

For context I am using the azurerm_key_vault_key terraform resource to create an secp256k1 key. I can output the X and Y coordinates for this key as strings that look like this (appears to be a base64 ...
Karl's user avatar
  • 5,658
0 votes
0 answers
110 views

Confusion around point addition on secp256k1

I am using https://github.com/HareInWeed/gec for point addition on the secp256k1. The code below adds two points on secp256k1 curve and displays the results. #include <gec/utils/macros.hpp> #...
Nikhil Srinivas's user avatar
0 votes
1 answer
95 views

Elliptic Curve Cryptography Key Verification fails

I'am trying to get a feel for Elliptic Curve Cryptography. I wrote a small Python program below to generate key material but I don't get the same result for y_squared and Q.y^2. I'am using the ...
Mehkir's user avatar
  • 11
0 votes
0 answers
109 views

Using ECC-based p12 Certificates BP256 in an Electron Application

I'm working on an Electron application where I need to establish an HTTPS connection using ECC-based p12 certificates. As I understand, nodejs already supports some curves, but I need specifically BP-...
Serdar D.'s user avatar
  • 3,143
0 votes
1 answer
33 views

Boolean Value as ECDSA Y-Coordinate

IANA "COSE Key Type Parameters" includes the following: Key Type Name Label CBOR Type 2 (EC2) crv -1 int/tstr 2 (EC2) x -2 bstr 2 (EC2) y -3 bstr/bool 2 (EC2) d -4 bstr The information ...
Takahiko Kawasaki's user avatar
1 vote
1 answer
37 views

Bouncycastle migration from python fastecdsa library for Custom Fp Curve

Due to some security requirements, we need to implement a sign/verify for a custom EC Curve defined as: https://docs.starkware.co/starkex/crypto/stark-curve.html, the issue I am encountering is that ...
Stefano's user avatar
  • 412
2 votes
1 answer
613 views

NodeJS crypto verify.verify not working for ES256 P-256 JWT but same code works for RSA

I am trying to write a "pure" NodeJS function that will verify the signature on a JSON Web Token as the environment I am deploying into does not have this package available. The code works ...
Neil Skilling's user avatar
1 vote
1 answer
631 views

How to generate derive shared secret key from public key

I am reverse engineering an application. What I noticed is that in a part of this application, a request is made to the server and a key is received from the server in base64 format. Then it converts ...
Majid Rezaei's user avatar
0 votes
0 answers
340 views

How to get native points on a elliptic curve from an existing addition of points

I'm working on elliptic curves with SageMath. I know : The equation of the curve E defined by y^2 = x^3 + ... : E = EllipticCurve( GF(K), [m, n] ) the addition of points A and B (A+B) : (x3;y3) the ...
Julien's user avatar
  • 699
0 votes
0 answers
52 views

Unable to use specific EC_KEY operations from 'cryptography' packages openssl backend

I am trying to use the EC arithmetic operations in OpenSSL by using the cryptography python package's default_backend. I need to perform point multiplication, addition, etc. on the public keys that ...
TP0G's user avatar
  • 1
0 votes
1 answer
257 views

Can I use a BLS12-381 private key to sign Ethereum transactions?

I'm new to cryptography and I've recently been studying BLS signatures. Please forgive me if I make any mistakes while writing. I've tried generating a BLS key pair and using the private key to derive ...
pgermani's user avatar
2 votes
1 answer
208 views

Import a Key to Azure Key Vault (C#)

I'm having issues in importing an EC key to Azure Key Vault while using the SDK. Code: var ecKey = Nethereum.Signer.EthECKey.GenerateKey(); var privateKey = ecKey.GetPrivateKeyAsBytes().ToHex(); var ...
Wilson's user avatar
  • 41
6 votes
1 answer
400 views

about use of secp256r1 and x25519

I'm not familiar with ECC, sorry if this question is a bit weird/stupid. I'm implementing some protocol using some 3rd party repository (Private Join and Compute), and the repo only supports built-in ...
Daisy Ding's user avatar
1 vote
1 answer
162 views

crypto/elliptic: attempted operation on invalid point

I'm using the r and s value after signing a payload to then decode it back to a signature. First I convert the string values to a bigInt with myBigInt := new(big.Int) myBigInt.SetString(byteValue, 16) ...
amlwwalker's user avatar
  • 3,171
0 votes
0 answers
766 views

Public key generator in Python (SECP256K1 elliptic curve cryptography)

I am currently new in Python and cryptography. I am trying to make a public key of SECP256K1 elliptic curve manually(without related library use), from a random generated private key as I learned. The ...
hib0823's user avatar
0 votes
0 answers
57 views

Data validation fails when send to pyodide

The problem is the code is working but it does not verify. The sample below was the first iteration of the implementation of the code. below. That code operates accurately, but once I save the ...
Mr.Deadpool's user avatar
0 votes
2 answers
293 views

Not getting the right result in base64 string when I try to convert base64 encoded string EC Public Key generated on iOS to Java PublicKey

As the title suggests I am trying to convert base64 encoded string (EC Public Key) generated on IOS device(Swift) to Java PublicKey which will be used to calculate a Shared Secret Key between two ...
codeasus's user avatar
0 votes
0 answers
164 views

How to convert raw EC key to PKCS8 without node:crypto export function

I need to convert raw EC key to pkcs8 and vice versa. I am using react-native-quick-crypto as a replacement for node:crypto. sadly, it does not include node's crypto.createPrivateKey(...).export(...) ...
David Novák's user avatar
  • 1,455
-1 votes
1 answer
200 views

get ecc public key from x and y components in PEM format using openssl

Can I get the ecc public key from x and y components in PEM format using openssl? X: 1d 43 15 e3 84 99 d6 f6 9f 49 61 8a ae ec f2 4f Y: b5 1a 86 cf f9 0e 01 af 3a 9a 52 b3 c6 58 2c 48 thank you!!...
aiden.yang's user avatar
0 votes
0 answers
34 views

Elliptical Curve point generation - why do the calculations fail after the 2nd loop?

I've been trying to program Elliptical Curve Cryptography in python for a week or two now, I've managed to create a program that will take an object point P and it will (attempt) to produce nP. ...
George Fox's user avatar
1 vote
1 answer
443 views

Elliptic curve point - verify point is on the curve

I'm trying to verify that an EC point is on the curve. I've looked at a dozen similar issues around, but still can't get it right. I'm using OpenSSL (in C). Long story short, my software has generated ...
Pawel Klapuch's user avatar
1 vote
0 answers
196 views

how to graphically show bitcoin public key on the curve?

From what i understand private is a point on the Elliptic curve and a public key is x,y co-ordinates on the curve therefore showing them on the graph should be easy to those who knows how to code. The ...
terry franklin's user avatar
0 votes
1 answer
52 views

Problem "EXCEPTION NOT FOUND" in Cryptography (Python)

CODE start_time1 = time.time() ec = EC(a, b, num) g, _ = ec.at(at) assert ec.order(g) <= ec.q # ElGamal enc/dec usage eg = ElGamal(ec, g) # mapping value to ec point # "masking&...
Jaivardhan Singh's user avatar
0 votes
0 answers
174 views

Should shared secret be hashed (SHA-256) in ECDH?

FIDO2 uses ECDH (elliptic curve diffie hellman) for key agreement. However, in its sequence diagram, I see they hash the shared secret using SHA-256. Is there any specific reason to use the hash ...
Mohammad Siavashi's user avatar
0 votes
1 answer
203 views

ECIES secure mode and padding scheme for ECC Algorithm -Java

What is the best secure mode and padding scheme for ECIES replacement. Cipher c = Cipher.getInstance("ECIES"); public static byte[] eccEnc(String msg,String pub) throws ...
Varun's user avatar
  • 196
0 votes
0 answers
27 views

What does it mean to encrypt from a key to a key?

I'm trying to understand the key exchange happening with CurveMQ described here. http://curvezmq.org/page:read-the-docs My understanding of public key cryptography is you use a public key to encrypt ...
Dustin Butler's user avatar
-1 votes
1 answer
95 views

Computing the cardinality of an elliptic curve group over the finite field

My objective is to get the number of points on a curve over Fp with prime p being at least 160 bit and then print it out into a textBox in Winform. y^2= x^3 + Ax + B mod p After some research, I ...
Tuan Minh Luu Dat's user avatar
0 votes
1 answer
61 views

Alphabets in x , y coordinates of Elliptic graph

I was reading about the ethereum address generation process. I am very confused that when Private key generated is processed under "Elliptic Curve Digital Signature Algorithm" , we get a ...
Brijesh Roy's user avatar
0 votes
1 answer
275 views

BouncyCastle gets error 'public key presented not for certificate signature' for retrieved ECPublicKey

I am trying to use BouncyCastle library for generating X509Certificate in a .Net application, meanwhile i want to use keys stored in HSM. My solution is generating EC key-pair in HSM, returning ...
morteza's user avatar
  • 135
0 votes
1 answer
131 views

GCP KMS - Elliptic curve Signature

I am using google cloud KMS to manage my keys. Using JAVA client libs to interact with KMS. I receive byte array as a signature of a message as below byte[] plaintext = message.getBytes(...
neo007's user avatar
  • 27
2 votes
1 answer
795 views

Javascript Web Crypto - Unable to import ECDH P-256 Public Key

I'm trying to exchange public keys between Browser and Server, and generate secret to be used for encryption of data. I'm trying to utilize ECDH (Elliptic Curve Diffie-Hellman). On the Server side I'm ...
Zoka's user avatar
  • 403
0 votes
1 answer
270 views

Given a Java ECPublicKey ECDSA PublicKey, how can I build an SSH2 public key?

I have created a ECDSA key and now need to convert this to SSH2 key. final KeyPairGenerator keyGen = KeyPairGenerator.getInstance("ECDSA"); ECGenParameterSpec params = new ...
Vicky's user avatar
  • 1
1 vote
4 answers
888 views

panic: gob: type elliptic.p256Curve has no exported fields

I am trying to build a blockchain project when I'm catching an issue about gob Serialize. I have a struct Wallet which uses elliptic.P256() Curve struct, and when I'm trying to serialize Wallet, a bug ...
Vango Lu's user avatar
2 votes
1 answer
737 views

GO Language ECDSA verify the valid signature to invalid

I coded the ECDSA functions in my C++ program. When I test my signature it works fine in my C++ ECDSA verify function, but not every test pass on the GO language. Therefore, I tried to export my ...
richard's user avatar
  • 56
0 votes
1 answer
344 views

EXC_BAD_ACCESS code=257 at SecKeyIsAlgorithmSupported

I have a KeyChain class where I sign a string. I got Thread 8: EXC_BAD_ACCESS (code=257, address=0x3fd574bc6a7ef9db) error at SecKeyIsAlgorithmSupported function. I could not figure out why this error ...
Hilal's user avatar
  • 912
0 votes
1 answer
464 views

Elliptic Curve encryption and decryption on Solidity and Python

I am trying to create a smart contract where I have to encrypt (and decrypt) data that I receive from a Python script running on a client. The data will be encrypted on the client-side, and I will ...
Arka Seth's user avatar
1 vote
1 answer
648 views

ECDH key agreement generated Key Pair is always invalid in Android 12

I've written the below code following the official guide for ECDH Key Agreement on Android. private static final String EC_SPEC = "p-256"; private static final String KEY_PAIR_NAME = "...
exploitr's user avatar
  • 842

1
2 3 4 5
14