Diffie-Hellman is a method for establishing a shared secret that can be used as a cryptographic key.

learn more… | top users | synonyms

31
votes
3answers
12k views

Is there any particular reason to use Diffie-Hellman over RSA for key exchange?

I often see RSA being recommended as a method of key exchange. However, the Diffie-Hellman key exchange method appears to be secure as well. Is there any considerations one should take into account ...
14
votes
2answers
2k views

How does non-ephemeral Diffie-Hellman key exchange become compromised in SSL when the RSA private key is leaked?

From my understanding, one of the major reasons we recommend Diffie-Hellman Ephemeral (e.g. DHE or ECDHE) over non-ephemeral DH, for SSL / TLS, is that compromise of the RSA private key (i.e. private ...
9
votes
2answers
5k views

Decrypting TLS in Wireshark when using DHE_RSA ciphersuites

How can I decrypt TLS messages when an ephemeral Diffie-Hellman ciphersuite is used? I am able to expose the premaster secret and master secret from the SSL Client. Using that, how to decrypt the ...
7
votes
3answers
3k views

Can someone explain a little better what exactly is accomplished by generation of DH parameters?

I'm setting up a node.js server: https.createServer({ ... ciphers: 'ECDHE-RSA-AES128-SHA256:AES128-GCM-SHA256:RC4:HIGH:!MD5:!aNULL:!EDH', honorCipherOrder: true }, app).listen(443); ...
7
votes
1answer
729 views

What's the hash for in ECDHE-RSA-AES-GCM-SHA?

Presumably the SHA is for deriving the AES key from the shared secret. Where else is the hash used? ECDH just does ECC (no hashing). RSA does masking and padding but this doesn't involve the ...
6
votes
2answers
2k views

1024-bit DHE vs 2048-bit RSA

Currently with apache/mod_ssl, if DHE is enabled then a 1024-bit ephemeral key will be used. I found the following quote in Adam Langley's blog: Ideally the DH group would match or exceed the RSA ...
6
votes
1answer
310 views

DH parameters recommended size?

I'm setting up EAP-TLS on my wireless router, and am currently generating DH parameters for FreeRADIUS. First, what do these parameters do? Also, what size should they be? I've been generating the ...
6
votes
2answers
180 views

Should I test my SSL certificate for “RSA Shared Primes” before using it?

There are several papers from 2012 that say it's possible to factor several moduli by factoring shared primes. The link above includes python sourcecode to verify and test for this fact. Given this ...
5
votes
1answer
392 views

What are the OpenSSL standard Diffie Hellmann parameters (primes)?

I recently generated some custom Diffie Hellmann parameters which are basically just long (in the below case 4096 bit) primes. Those are then used in the key exchange process. I used the following ...
5
votes
2answers
458 views

Are Telegram secret chats secure assuming MTProto isn't?

For those who don't know: Telegram is a partially open source Whatsapp alternative (Server is closed source) which offers secret chats and normal chats. Secret chats are encrypted with Diffie-Hellman ...
4
votes
1answer
315 views

Diffie-Hellman key exchange

The following image attempts to explain the diffie-hellman key exchange for people not strong in maths such as myself: I do understand how the colour/paint example illustrates the idea. But I'm a ...
4
votes
2answers
370 views

What is the difference between DHE and ECDH?

I learned that perfect forward secrecy is implemented through DHE and ECDH but what is the difference between these 2 key exchanges? Also can someone explain how perfect forward secrecy works? I've ...
3
votes
1answer
115 views

How to reduce the size of a key established with Diffie-Hellman?

When I generate a key with the a Diffie Hellman method (DH), the established shared key will be of the same size as the prime which is used. As far as I have read this should be at least 2000 bits for ...
3
votes
1answer
110 views

Can we build a key exchange protocol without certificates?

Assume that the server and the client both has some secret key K. Is it possible to have a key exchange protocol with authentication between them such that MITM attack cannot hold and if the key is ...
3
votes
1answer
2k views

OpenVPN dhparam

One of the steps for setting up OpenVPN is running the command openssl dhparam -out dh1024.pem 1024. The man page tells me this 1024 value refers to the number of bits. Why is the value 1024 ...
2
votes
3answers
88 views

How can DH provide a known secret to two parties over an unencrypted connection without it being intercepted via MITM?

Without using Private and Public keypairs, i do not understand how Diffie-Hellman is able to generate a secret key between two parties on the internet without passing something between that could be ...
2
votes
3answers
1k views

Javascript Diffie-Hellman and AES protocols

I am using the BigInteger Javascript library to create a symmetric key using Diffie-Hellman protocol. I want to create 128,160 or 192-bit keys. After some research, I have found out that I should use ...
2
votes
2answers
347 views

Why should the dh keylength match rsa length in tls?

A few sources state that the DH keylength (bits of the prime) should match the keylength of rsa for TLS. For example SSL_set_tmp_dh(3) from openssl has example code on how to match the dh parameters ...
2
votes
3answers
4k views

Diffie-Hellman and its TLS/SSL usage

I'm struggling to understand the (non-)use of Diffie-Hellman (DH) in TLS. DH has been around for a long time now, why does almost nobody use it, yet? DH is only being used for "key sharing", why ...
2
votes
2answers
160 views

How secure is Samy Kamkar's Anti-MITMA Diffie-Hellman Key Exchange Technique?

I'm currently using Diffie-Hellman to encrypt data sent across an arbitrary link (can be ethernet, Wi-Fi, USB, bluetooth, etc), and I'm not a huge fan of the potential that DH is vulnerable to an ...
2
votes
2answers
193 views

For DHE_RSA_.. Cipher Suites what is RSA used for?

In addition to achieving PFS with DHE, we want as little as possible to be revealed when the server's private key is revealed. So, what is RSA used for in DHE_RSA cipher suites? What does the server ...
2
votes
1answer
257 views

Using Diffie–Hellman key protocol to create a safe secret key

Let's say, I have a friend far from me and I want to send some secret messages to him. I have to say, I'm pretty newbie in security. That's why I'm wondering, does the Diffie–Hellman key exchange ...
2
votes
1answer
87 views

What to do with the extra bytes in ECDHE-RSA-AES-GCM-SHA?

I'm trying to implement, as an exercise, a protocol based on the cipher suite ECDHE-RSA-AES256-GCM-SHA384. As I understand things, ECDHE is used for the key exchange, RSA for the authenticity of the ...
2
votes
2answers
1k views

Is there a key length definition for DH or DHE?

I found this in wiki The Finite Field Diffie-Hellman algorithm has roughly the same key strength as RSA for the same key sizes. The work factor for breaking Diffie-Hellman is based on the discrete ...
2
votes
1answer
274 views

What are the implications of using the same DH parameters in a TLS server?

For a DHE cipher, nginx hard-codes the Diffie-Hellman parameters to use base 2 and a fixed 1024-bit prime (modulus) if no custom DH parameters are configured. These parameters are public (sent in ...
1
vote
2answers
491 views

What is the difference between Diffie Hellman generator 2 and 5?

Generating Diffie Hellman parameters in OpenSSL can be done as follows: $ openssl dhparam -out dh2048.pem 2048 Generating DH parameters, 2048 bit long safe prime, generator 2 This is going to take a ...
1
vote
1answer
299 views

OpenSSL DH modp size

If OpenSSL is configured to use a DH for key exchange, e.g. TLS_DHE_RSA_WITH_AES_128_CBC_SHA, where does it take the size for modp (or even modp itself) from? The following is a screenshot from ...
1
vote
1answer
47 views

Diffie Hellman Hash MITM

I've seen an application recently that used the Diffie Hellman algorithm. It is not a Ephemeral Diffie-Hellman implementation, but rather a Diffie Hellman one. After the secret keys have been ...
1
vote
1answer
69 views

Why OpenVPN is using both certificates and DH?

I am reading about OPENVPN and I am a little bit confused. In the OPENVPN howto website, there is a step by step setup guide for generating certificates and diffie-hellman (DH) params. However, I cant ...
1
vote
2answers
62 views

Client-server encryption technique explanation (TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256, 128 bit keys)

I opened a web page using https. When I looked at the page info provided by my browser (Firefox) I saw following: Connection encrypted: High-grade Encryption ...
1
vote
1answer
679 views

ECC Brainpool Standard Curves and Curve Generation with Bouncy Castle which seed to use?

I want to implement a ECC Key Agreement with a Brainpool curve brainpoolP512r1 or brainpoolP512t1. I'm not clear about whichseed value to use (and how). In this document ...
1
vote
2answers
176 views

Is it safe to use Diffie-Hellman public keys as nonces to protect against replay attacks?

I have an interesting case regarding protection against replay attacks. Under the assumption that Alice and Bob have used Diffie-Hellman key exchange to establish a secure temporary session, would it ...
1
vote
2answers
212 views

How to treat/hash ECDH shared secret to use as keys for AES?

I'm doing some studies/development for a security system that would use ECDH with ephemeral keys. In my code I'm currently using a 256-bit EC, so when the two parts compute the shared secret, I get a ...
1
vote
1answer
319 views

Can manual hash verification defend against a DH MITM attack?

I understand how DH key exchange is vulnerable to a MITM attack. When Alice sends Bob g, p and her public key, if she also sent a value H that was a hashing of the values g,p, and public key all ...
1
vote
0answers
74 views

How to generate DSA keypair for browserID

As a bit of a learning exercise, I'm trying to understand and implement a client for the Firefox Accounts Browser sync API. I'm up to the point where I'm trying to ask the server to give me a ...
1
vote
0answers
51 views

Any Suggestion Exchanging shared key between process via port in untrusted machine (infected my malware)?

I am trying to get shared key between Firefox extension and a java program running in same machine. I am communicating both application via socket. My assumption is that malware is running in ...
1
vote
2answers
139 views

Is a Diffie Hellman Ephemeral key good material for being used as a symmetric cipher algorithm key?

I am designing a secure protocol (for academic/learning purposes) and I am at the point where I need to (re)design the key exchange step. In my previous implementation, I used to rely on RSA to ...
0
votes
1answer
61 views

How much harm can an attacker do on the Diffie-Hellman exchange?

I'm looking at a system that uses an unprotected Diffie-Hellman exchange to negotiate a key for the session encryption. That Diffie-Hellman is not secure against man-in-the-middle attacks is textbook ...
0
votes
1answer
43 views

Evaluation of cryptosystem for authentication and keyexchange

I'm a masters student in computer science who works part time with my own company as a consultant. My lastest project is based on my bachelor thesis which handles everything except the security. The ...
0
votes
2answers
311 views

Why don't more websites implement Perfect Forward Secrecy?

From what I understand, all it takes to enable PFS on a webserver is adding ephemeral cipher suites (ones that use DHE and ECDHE for the key exchange) to the list of cipher suites used in SSL/TLS ...
0
votes
1answer
35 views

Is encrypting and subsequently sending a known clearext string after a Diffie-Hellman bad design?

I'm writing a small protocol that relies on a DH handshake, generation of a shared secret, and subsequent AES encryption/decryption using that generated secret. I want to add a built-in test message ...
0
votes
1answer
397 views

Which is better in “DH-group14-sha1 with hmac-sha2-256” and “DH-group-exchange-sha256 with hmac-sha2-256” from performance and security perspective?

In our product (embedded system), so far we were using diffie-hellman-group1-sha1 with hmac-sha1. But due to security concern we are planning to use diffie-hellman-group14 for key exchange and ...
0
votes
2answers
45 views

DHE Verification

I'm just struggling to get my head around this. In certificate signing with static Diffie Hellman the public key and certificate information is sent to the CA who verifies the certificate ...
0
votes
1answer
165 views

Is the Station-to-Station protocol secure?

After I've read a lot about key exchange many sources state that the Station-to-Station is secure, since it also verifies the entity on the other side. Well how is that true, if an active Man in the ...