Questions tagged [diffie-hellman]

Diffie-Hellman, commonly abbreviated DH, refers to a public key cryptographic protocol used by two parties to produce a common shared secret.

Diffie-Hellman, commonly abbreviated DH, refers to a public key cryptographic protocol used by two parties to produce a common shared secret.

It is most commonly used to implement key agreement, by using the properties of exponentiation modulo a large prime. Another variant uses the properties of elliptic curve groups and is commonly abbreviated ECDH.

For further reading see Wikipedia

431 questions
3
votes
1 answer

Node.js crypto key creation using Java

I have this code in node.js, it create Key using Crypto. Can i create same key using Java? diffieHellmanConfig': {       'group': 'modp14',       'encoding': 'base64'     } const clientDHInstance =…
3
votes
2 answers

Difference between Bouncy Castle ECDH and the .net4 native ECDiffieHellmanCNG

I've been able to generate a private key using the ECDiffieHellmanCNG in .net4 and I've also used the Bouncy Castle C# library to successfully generate private keys. I want to know why the .net 4 version generates a byte array of chars and the…
hobeau
  • 873
  • 1
  • 11
  • 24
3
votes
1 answer

How to use HKDF with ECDiffieHellmanCng

I am attempting to use the ECDiffieHellmanCng class to perform key exchange operations between a desktop and a device connected over BLE. The specs of the system require that HKDF be used to derive the key. That doesn't appear to be an option for…
Sam
  • 1,325
  • 1
  • 13
  • 26
3
votes
0 answers

How to generate Diffie-Hellman parameters in golang

Is there a Golang equivalent to the following openssl command? openssl dhparam -out dh.pem 2048 I would like to be able to generate Diffie-Hellman parameters with golang and not need to invoke openssl.
Adam
  • 47
  • 1
3
votes
0 answers

Enabling ECDH in secp256k1 python?

I have installed secp256k1, so that i can use ECDH functionality sudo apt-get install libssl-dev build-essential automake pkg-config libtool libffi-dev libgmp-dev libyaml-cpp-dev pip install secp256k1 on its documentation its, written that NOTE:…
GraphicalDot
  • 2,644
  • 2
  • 28
  • 43
3
votes
1 answer

How to Encode nodejs ecdh public key as pem

Unable to sign a file with nodejs crypto I am trying to verify a signed document created like in this thread using the method verify.verify() with the ECDH public key. Therefore, i guess, i have to format the raw public key into valid PEM. How would…
Roflex
  • 55
  • 8
3
votes
0 answers

Doing ECDHE key exchange using C#

I am trying to do ECDHE key exchange over TLS 1.2 using .net. The server is responding with a server_key_exchange message, which begins with 04, so I guess it is unencrypted. From my understanding the first 32 bits of the message are considered as a…
frenzy man
  • 81
  • 1
  • 7
3
votes
0 answers

How to enforce DH key size in the OpenSSL client?

In our Application, we use OpenSSL for secure connections and we use DH for key exchange. With the recent OpenSSL versions, minimum key length that can be used is 768 and 1024 is recommended. Our application is peer-peer application and to comply…
Shiva
  • 114
  • 3
  • 12
3
votes
0 answers

How to get Prime and Generator value from dhparam.pem?

I use command in openssl to create a dhparam.pem. openssl dhparam -outform PEM 2048 -out dhparam.pem I need to calculate A = g^a mod p. With g is generator value and p is prime value from dhparam.pem file. I am using C#, so How do I get value…
Vũ Hoàng
  • 255
  • 1
  • 14
3
votes
0 answers

Generate shared secret key using public and private key in C#

Taken from http://en.wikipedia.org/wiki/Public-key_cryptography In the Diffie–Hellman key exchange scheme, each party generates a public/private key pair and distributes the public key. After obtaining an authentic copy of each other's public…
Dennis
  • 3,528
  • 4
  • 28
  • 40
3
votes
0 answers

Qt Android error: Diffie-Hellman parameters are not valid

In a Qt app I make a GET request to https://www.google.es using QNetworkRequest. In Linux desktop this works fine, I get the page's content, but when I run it in my Android device I get the following error in my QNetworkReply: Diffie-Hellman…
Koas
  • 402
  • 3
  • 10
3
votes
1 answer

Diffie-Hellman Key Exchange - Clarification?

A Brief : Alice and Bob is trying to communicate without wanting Eve (which is listening) to know what they are going to talk about. So Bad Eve | | Alice ------------+--------------- Bob …
Royi Namir
  • 144,742
  • 138
  • 468
  • 792
3
votes
2 answers

Determine Diffie-Hellman "Parameters" Length for a TLS handshake in Java

I'd like to make an HTTPS connection to a server and, if I'm using non-ephemeral DH key exchange, I'd like to know what the parameters are for that connection. Actually, I don't really care if it's ephemeral or not. What I'm looking for is the…
Christopher Schultz
  • 20,221
  • 9
  • 60
  • 77
3
votes
1 answer

TLS 1.2 ECDHE_RSA signature

I'm currently working on a Java TLS server. I'm trying to get the following CipherSuite to work : TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA When I test it using openssl s_client I get the following error after the ServerKeyExchange message…
Alpha4
  • 41
  • 1
  • 9
3
votes
1 answer

How to use RSA encryption to power to numbers on Java Card

I am kind of new in Java Card development and I try to implement NAXOS protocol on JavaCard and my problem is to power to variables. My JavaCard version is 2.2.1, I use such code to do that: package RsaEncryption; import…
DanoPlu
  • 279
  • 1
  • 16