Questions tagged [x25519]

17 questions
6
votes
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…
3
votes
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
  • 33
  • 1
  • 5
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,859
  • 24
  • 25
2
votes
2 answers

(C#) Calculate key share using private key and public key on (EC)DHE x25519

I am working with (EC)DHE encryption type x25519 and I have a big problem on calculating shared key. I have three key: Alice’s private key: a : "984a382e1e48d2a522a0e81b92fd13517e904316c6687a59d66cd2e5d9519a53" Alice’s public key: Q(a) = a*G(a) :…
Kom Pe
  • 35
  • 5
2
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
  • 401
  • 1
  • 4
  • 8
1
vote
0 answers

Does Java 8 with Bouncy Castle as security provider support X25519 namedgroup?

I am using java 8 (1.8.0_332-b09) and bouncy castle as security provider for establishing a TLS 1.3 connection. As part of handshake, Client Hello in packetcapture shows the supported namedgroups as follows : secp256r1, secp384r1, secp521r1,…
Discovery
  • 29
  • 2
1
vote
2 answers

Java X25519 shared secret is not correct when using testing vectors from RFC7748

When using RFC7748 test vectors for elliptic curve diffie hellman in java, I cannot get expected shared secret key. I am able to do so in other languages. I am using openjdk 11 with default Sun security provider. I found official tests which use…
Pain
  • 13
  • 1
  • 3
0
votes
0 answers

Problem with extracting Private Key from PKCS8 wrapper Blob

I have been facing issues in using a private key created using Java Code in my python code. While generating a Private key on Python works well for X25519 key exchange, same is failing for Java generated keys. Following are my keys: Java Key:…
0
votes
0 answers

Convert X25519 raw binary key to pem file for openssl

I have a binary file with one x25519 public key (raw format). I am looking for a way to create a pem (asn.1) to pass to openssl. C or python solutions would be fine too. Any advise?
seq16
  • 17
  • 4
0
votes
0 answers

How to create private and public key using X25519 in android?

Currently I am using bouncy castle library but the keys size is way more than 32.can anyone tell me how to get the key pair with x25519 curve in android?
0
votes
1 answer

X25519 calculated shared key is different in two programs

I have written two programs which will exchange X25519 public keys and then calculate shared secret. This is just a test, so public keys are exchanged trough text files (in PEM format), program is until you tell it to continue in order to generate…
jsfrz
  • 99
  • 9
0
votes
1 answer

tweetnacl -- What input does nacl.box.keyPair.fromSecretKey expect?

I am little bit confused about the API of tweetnacl. Does the function nacl.box.keyPair.fromSecretKey except the secretKey argument to be already clamped? Or it is it fine to provide a random byte string? The way I read the code, tweetnacl does the…
0
votes
0 answers

SSL Handshake problem when running as jar but not in ide

I have a Java 16 program that tries to connect to an email server. It works fine when run through the Eclipse IDE. Here is the debugging log for the successful connection request and response (sorry it's so long - I wasn't sure which bits are the…
Michael
  • 141
  • 2
  • 12
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
  • 2,167
  • 2
  • 24
  • 44
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
  • 365
  • 1
  • 3
  • 17
1
2