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.

In mathematics, an elliptic curve is a smooth, projective algebraic curve of genus one, on which there is a specified point O (the point at infinity). An elliptic curve is in fact an abelian variety — that is, it is a (necessarily commutative) group with respect to an algebraically defined multiplication — and O serves as the identity element. Often the curve itself, without O specified, is called an elliptic curve.

685 questions
0
votes
0 answers

Is there a way to create a sign function in python?

import re import math from random import randint import hashlib P = (-0.15, 2.645) Q = (0.7, 2.71) max_mod = 1.158 * 10 ** 77 def SHA256_INT(text): return int(f'0x{hashlib.sha256(text.encode("ascii")).hexdigest()}', 0) def…
0
votes
3 answers

Optimal frequency of modulo operation in finite field arithmetic implementation

I'm trying to implement finite field arithmetic to use it in Elliptic Curve calculations. Since all that's ever used are arithmetic operations that commute with the modulo operator, I don't see a reason not to delaying that operation till the very…
0
votes
1 answer

Is there is a way to Import/Retrieve Keypair from Public Key in Elliptic module node.js?

I'm currently facing the challenge about 'Elliptic' module, I've created keyPair and I want to POST these keyPair object to another endpoint, what I facing now is that after JSON.parse the stringified KeyPair object it miss raw data of original…
0
votes
1 answer

Elliptic Curve Cryptography (ECDSA) Private Key Matches Public Key (Java - Bouncy Castle)

I try to use Elliptic Curve Digital Signature Algorithm (ECDSA) with Bouncy Castle and Java. I want to generate a public key and private key. The problem is that these keys have the exact same values. Let's look at the code: KeyPairGenerator…
balazsh
  • 17
  • 3
0
votes
1 answer

API for setting ECC Key mbedTLS

I am trying to set the ECC private key explicitly with mbedTLS for ECDSA signing. The key has been generated externally from mbedTLS and consists of the following arrays for the private key and the public key in the NIST secp256r1 curve (below). In…
0
votes
1 answer

java.security.InvalidAlgorithmParameterException on Java 8 but works on Java 11

So let's assume you want to verify a signature using a public key that uses ECDSA algorithm with brainpoolP256r1 elliptic curve. For running the code below, follows these steps: generate a keypair of brainpool using these commands: openssl ecparam…
Florin
  • 55
  • 8
0
votes
2 answers

How to create animations of elliptic curves in manim?

I'm playing with manim and I'd like to create an animation with an elliptic curve. This is my code, in the file functions.py: from manim import * class EllipticCurve(Scene): def construct(self): basic_ec = FunctionGraph( …
Hyperion
  • 156
  • 11
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

Is there any way to plot xy diagram of points of elliptic curve over finite field with huge number p defined by standard EC (p-192,p-256...)?

Is there any way to plot xy diagram of points of elliptic curve (such as NIST p-192,p-224,p-256...) over finite field? I tried with p-256, but it has very big number of p thus when I use for loop it takes huge amount of time to go through the loop.…
Alokin
  • 9
  • 2
0
votes
1 answer

Brute force attack for discrete log problem (Python)

I'm still learning Python and trying to wrap my mind around brute force attacks using for loops in Python. I made this for loop to try every number from 0 to 999999 and store it in the variable n. Instead of letting my for look run forever, I want…
0
votes
1 answer

Uninitialized Key Exception when using getK() in Elliptic Curve DSA on javacard

When trying to use the getK() method on a key pair in JavaCard I get this exception code: CryptoException.UNINITIALIZED_KEY Here is my code where I generate the key pair: KeyPair key = new KeyPair(KeyPair.ALG_EC_FP,…
LozCodes
  • 109
  • 8
0
votes
1 answer

Constructing an ECPublic Key in Java from Java Card

This question relates to this one here: Recovering an ECPublicKey from JavaCard to Java However in the answer it isn't explained how to extract x and y - how can I do this?
LozCodes
  • 109
  • 8
0
votes
1 answer

Python function for Edwards curves point doubling and addition

I'm writing a Python script for testing C implementation of Edwards elliptic curves point addition and doubling. I'm following this paper and implementing the formula set (5) for "unified addition" (which means any 2 points can be added), and…
DannyNiu
  • 1,313
  • 8
  • 27
0
votes
0 answers

Looking for simplification of Elliptic curve multiplication calculator

I am looking for a reduced way of this code. I had to do the division separately because of the multiplicative inverse condition. """This code calculates the multiplication Elliptic curves over Zp""" #Initial values for testing yq = 3 yp = 3 xq =…
Franco
  • 11
  • 3
0
votes
1 answer

Set an EVP_PKEY from EC raw points, PEM or DER in both OpenSSL 1.1.1 and 3.0.x

I want to write some code that works against OpenSSL 1.1.1 and 3.0.x and future versions. The code should set an EVP_PKEY to a particular EC key pair from either the points, DER or PEM. I don't really care which, because I know how to convert…
lundblade
  • 91
  • 1
  • 3