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

Generating 64-byte public key for DH key exchange using Bouncy Castle

I need to generate a key pair for Diffie-Hellman key exchange using the secp256r1 curve using Bouncy Castle in C#. The public key should be 64 bytes (I'm not sure which format this is (compressed?), but I can find out). I have the following code,…
InfoSec
3
votes
1 answer

How to import/export Java EC keys to/from X9.63 encoding with Java 8

I am looking into writing a Java 8 program to do a ECDH exchange with another piece of software using a library (wolfSSL/wolfCrypt) that can only export/import ECC public keys in X9.63 format (their wc_ecc_export_x963() function). I would greatly…
QuantumMechanic
  • 13,795
  • 4
  • 45
  • 66
3
votes
1 answer

Diffie-Hellman Computing with VERY large numbers

I am trying to compute some values for a Diffie-Hellman key exchange. I understand the concepts, but the data that I'm working with makes me question the method. I have been given 5 values to work with p and g: // p and g BigInteger p = new…
Bret Hodgson
  • 113
  • 1
  • 11
3
votes
2 answers

Processing BigInteger issues

Assume the following Diffie-Hellman info which can also be found on this page 1)P string givenp =…
Panos Antoniou
  • 73
  • 1
  • 12
3
votes
4 answers

Chrome error "Server has a weak ephemeral Diffie-Hellman public key" for internal sites

Chrome seems to have released an update over the past week. This has caused at least 50 of our internal applications to throw the exception shown below. The solutions I have researched over the Internet, talk about updating the application server…
user1074593
  • 446
  • 1
  • 9
  • 23
3
votes
0 answers

How do you create an EVP_KEY for a peer key given the Base64 encoding?

Using OpenSSL, I've created my Diffie-Hellman Private/Public keys and received my peer's public key. I can decode my peer's key from Base64 string to byte array, but how do I poke that into my original Public/Private Key EVP_KEY structure so it can…
Bungles
  • 1,969
  • 2
  • 25
  • 54
3
votes
2 answers

diffie-hellman ssh keyxchange

I've set out to make a primitive SSH client in C#; you might remember me from posts such as primitive ssh connection (lowlevel) hehe. Anyway, things are great up until the time when I initiate a DH key exchange. I've compared the traffic when I…
Chuck
  • 125
  • 2
  • 6
3
votes
3 answers

Diffie-Hellman in Silverlight

I am trying to devise a security scheme for encrypting the application level data between a silverlight client, and a php webservice that I created. Since I am dealing with a public website the information I am pulling from the service is public,…
cmaduro
  • 1,672
  • 3
  • 21
  • 40
3
votes
1 answer

Shared Secret based on Elliptic curve Diffie–Hellman with CommonCrypto

I am looking for the methods in CommonCrypto to generate the shared secret based on ECDH (Elliptic curve Diffie–Hellman). I can find proprietary implementations like this one…
Simon
  • 509
  • 7
  • 25
3
votes
1 answer

DH Keypair generation time on Android

This is the code that I'm using to generate a DH keypair: KeyPairGenerator keyGen = KeyPairGenerator.getInstance("DH"); keyGen.initialize(1024, new SecureRandom()); KeyPair ackp = keyGen.generateKeyPair(); (without the needed try/catch, of…
cloud
  • 159
  • 1
  • 2
  • 6
3
votes
2 answers

Diffie-Hellman Key Exchange with Javascript sometimes wrong

After watching this video http://youtu.be/3QnD2c4Xovk I've been trying to follow it step by step, and haven't been able to produce the same results. Notably, when I try to do Math.pow(3, 54)%17, I get 7. While the speaker gets 15. I wrote a method…
3
votes
2 answers

Selection of parameters in Diffie-Hellman

maybe it's not so proper to ask this question here... anyway, I'm trying to use the gmp library for the implementation of DH, but the problem here I got is: Once, when I was doing the tests to observe the output, although big values of prime and the…
allenzzzxd
  • 331
  • 1
  • 10
  • 24
3
votes
1 answer

Why are the Diffie Hellman public parameters the same on every execution?

I am trying to implement the Diffie Hellman key exchange protocol. For the moment I am stuck at the public parameters generation. Every time I run the program, p and g parameters are the same (although the method documentation says "This will…
scarleth ohara
  • 357
  • 2
  • 12
3
votes
1 answer

Diffie–Hellman key exchange and Discrete Log

I have a general question, and for that I will give an example: assuming Alice and Bob chose the prime number 593 and a public g= 9 . Alice choose the number 530. Bob choose the number 147. Alice computes: x= g^a mod p = 574 Bob computes: y = g^b…
CnR
  • 351
  • 1
  • 6
  • 15
3
votes
1 answer

Load certificate keys into CngKey class for use with DiffieHellman (ECDiffieHellmanCng class)

This is related to .NET / C#. Lets assume there is a certificate + private key (P521 ECC one) inside a PFX or a PKCS#12 file. We have loaded this certificate and it's private key into the Windows certificate store by installing it (either double…
DeepSpace101
  • 13,110
  • 9
  • 77
  • 127