Questions tagged [ecdh]

97 questions
17
votes
3 answers

Implement Diffie-Hellman key exchange in Java

I am trying to implement Diffie-Hellman key exchange in Java, but I'm having a hard time understanding the specification: Complete the Diffie-Hellman key exchange process as a local mechanism according to JWA (RFC 7518) in Direct Key Agreement…
Noureddine AMRI
  • 2,902
  • 1
  • 19
  • 27
10
votes
3 answers

Elliptic Curve Diffie Hellman in ios/swift

Does iOS expose API for key generation, and secret key derivation using ECDH? From what I see, apple are using it (and specifically x25519) internally but I don't see it exposed as public API by common crypto or otherwise. Thanks, Z
Zohar Etzioni
  • 611
  • 5
  • 13
6
votes
0 answers

how to import ECDH public key (Cannot create a key using the specified key usages)

I am trying to run code with webcrypto but cannot seem to import ECDH public key. What am I missing ? I get this error: cannot create a key using the specified key usages. Browser: Google Chrome Version 71.0.3578.98 (Official Build) (64-bit) (Works…
Lily B
  • 4,973
  • 4
  • 34
  • 49
5
votes
1 answer

How to uncompress a single X9.62 compressed point on an ECDH P256 curve in Go?

Golang's elliptical curve library can derive a secret key given a public coordinate with a X and Y value (uncompressed coordinates). However, when the point given is a single value in X9.62 compressed form with a given y-bit, how do I uncompress…
Brandon
  • 13,354
  • 15
  • 67
  • 108
4
votes
1 answer

ios SecKeyCopyKeyExchangeResult sharedInfo parameters

Im trying to use the SecKeyCopyKeyExchangeResult function to obtain the shared secret from my local private key and received public key of server. Shared key is generated successfully and I able to decrypt incomming message with AES encryption Not…
Sergey Brazhnik
  • 591
  • 2
  • 12
4
votes
1 answer

Encrypting data using elliptic curve encryption in ios/swift

I've been trying to encrypt a string with an elliptic curve encryption using Security swift library, and i'm getting an error on the line with SecKeyCreateEncryptedData(...) : Thread 1: EXC_BAD_INSTRUCTION (code=EXC_I386_INVOP, subcode=0x0). I…
Dany
  • 199
  • 1
  • 2
  • 12
3
votes
1 answer

iOS - swift - Generating key pair for secp224k1 curve (ECDH)

I have been trying to generate public and private keys for the secp224k1 curve in iOS. We are using ECDH method to do api handshake between mobile and backend. In Java it is done using the below code. public static KeyPair getECKeyPair() throws…
jegadeesh
  • 731
  • 7
  • 22
3
votes
1 answer

Elliptic Curve Cryptography in React Native

Does anyone know if there is an implementation of Elliptic Curve Diffie Hellman cryptography (ECDH) for React Native? I found some libraries for this. each of them has some issues: react-native-ecc: it only generates key pairs and does not…
3
votes
0 answers

Java (Android): Diffie-Hellman key exchange process according to JWA (RFC 7518)

I need to use ECDH key exchange process in order to encrypt/decrypt messages between the client and the server. I use jose4j library for cryptographic functionality. I have the local key pair (private dC and public QC), I have the remote public key…
Michael Kessler
  • 14,102
  • 12
  • 45
  • 61
3
votes
1 answer

Encryption in swift using Security framework

I've been trying to encrypt and decrypt a string in swift using a Diffie Hellman key exchange and an elliptic curve encryption. But after the key exchange I can't restore a private key from a CFData shared1/shared2 variable for decryption. All i get…
Dany
  • 199
  • 1
  • 2
  • 12
2
votes
1 answer

Elliptic Curve Diffie Hellman public key size

I want to use Diffie hellman for generating a secret key between a c# Server and c++ Client. this code generates a public key for the server: serverECDH = new ECDiffieHellmanCng(ECCurve.NamedCurves.nistP256); …
fjahan
  • 83
  • 2
  • 7
2
votes
1 answer

NIST p256 Point Decompression: Finding Y-Coordinate For Base Point

I'm trying to implement NIST P256 point compression and decompression and I keep getting the wrong y coordinate when I solve y = sqrt(x^3 + ax + b). I figured a good test of the decompression would be to take the base point G defined by…
2
votes
0 answers

Implementing ECDH engine in OpenSSL 1.1.1

I am trying to write an OpenSSL Engine with ECDH support. I am following this page on the OpenSSL wiki : https://wiki.openssl.org/index.php/Creating_an_OpenSSL_Engine_to_use_indigenous_ECDH_ECDSA_and_HASH_Algorithms. However it is based on version…
2
votes
0 answers

how to convert a String to an ECDH PublicKey and check its connectness

I'm using Java with Bouncy Castle to convert a server-side string_1 to ECDH PublicKey, then convert the PublicKey to string_2 to check the code's correctness, but string_1 and string_2 are different and I don't know where's wrong. String key…
fanreson
  • 21
  • 2
2
votes
1 answer

Protection of an ECC Key in an Android Application

I have done an Android Application using an ECC Key pair. When I have developed it last year, I wanted to create the ECC key in the Android Keystore. Unfortunately, this ECC key is used to generate a session key thanks to ECDH, and ECDH is not…
OlivierGrenoble
  • 2,463
  • 2
  • 11
  • 24
1
2 3 4 5 6 7