Questions tagged [x25519]

9 questions
3
votes
0 answers

How to create x25519 public key from XZ coordinates?

As far as I understand, x25519 DH function used on Curve25519 uses only Xcoordinates as I can read in the wikipedia definition: The protocol uses compressed elliptic point (only X coordinates), so it allows efficient use of the Montgomery ladder for…
Guillaume Cisco
  • 2,707
  • 20
  • 20
1
vote
1 answer

Why does Curve25519 calculate key pair correctly even though its parameters are wrong?

It seems that .NET (Core 3.1) supports custom curves in ECC. So I've defined the Curve25519, and generated key pair by below code: using System; using System.Security.Cryptography; namespace Curve25519 { class Program { static void…
1
vote
0 answers

TLS 1.3 The client and server cannot communicate because they do not possess a common algorithm

I can no longer download a publicly available file using c# WebClient.DownloadFile() or HttpClient.ReadAsStreamAsync(). I can manually download using Chrome or Firefox. The website upgraded to TLS 1.3 and my program was previously working with TLS…
J Reynolds
  • 13
  • 4
0
votes
1 answer

Storing a X25519 key pair in a BouncyCastle BCFKS keystore

For the purposes of performing a Diffie-Hellman key agreement with Curve25519, I am generating the following key pair using BouncyCastle 1.68: // Generate a key pair KeyPairGenerator keyPairGenerator = KeyPairGenerator.getInstance("X25519",…
Bragolgirith
  • 1,547
  • 1
  • 16
  • 35
0
votes
0 answers

mbedTLS ECDH Curve25519 and openSSL

i try to learn something about diffie-hellman an elliptic curves... my target is actually to generate a key pair with openSSL on my windows pc, transfer the generated public key to my stm32 target and than calculate the secret with the mbedTLS…
0
votes
0 answers

why are fe_frombytes function of openssl in curve25519.c like this?

static void fe_frombytes(fe h, const uint8_t *s) { /* Ignores top bit of h. */ int64_t h0 = load_4(s); int64_t h1 = load_3(s + 4) << 6; int64_t h2 = load_3(s + 7) << 5; int64_t h3 = load_3(s + 10) << 3; int64_t h4 = …
0
votes
1 answer

How to calculate public key for TLS key exchange using OpenSSL functions?

I'm learning TLS 1.3 scheme and trying to implement basic handshake steps in C++ without using ready wrappers from OpenSSL such as SSL_accept or SSL_do_handshake. The project already uses OpenSSL for common crypto operations, so I would like not to…
Iceman
  • 303
  • 1
  • 3
  • 13
0
votes
1 answer

How do I pass a 44 Bytes x25519 public key created by openssl to CryptoKit which requires a key length of 32 Bytes

Suppose I create a x25519 key pair using openssl, it will output a 64 Bytes private key and the corresponding 44 Bytes Base64 encoded public key which would look like -----BEGIN PRIVATE…
Moritz Herbert
  • 371
  • 1
  • 3
  • 7
0
votes
2 answers

Where can I find the Curve25519 derive method implementation?

I'm playing with python library cryptography using openssl and x25519. By looking for the code of EVP_PKEY_derive I can see: ret = ctx->op.kex.exchange->derive(ctx->op.kex.exchprovctx, key, pkeylen, …
Guillaume Cisco
  • 2,707
  • 20
  • 20