Questions tagged [diffie-hellman]

The Diffie–Hellman key agreement is an anonymous, non-authenticated key-agreement protocol.

Filter by
Sorted by
Tagged with
298 votes
11 answers
467k views

"Diffie-Hellman Key Exchange" in plain English

Can someone explain what the Diffie-Hellman Key Exchange algorithm in plain English? I have read that Twitter has implemented this technology which allows two parties to exchange encrypted messages on ...
user avatar
139 votes
3 answers
165k views

What's the purpose of DH Parameters?

For a Diffie–Hellman (D-H) key exchange (TLS) the server generates a prime p and a generator g, which is a primitive root modulo p. When setting up a webserver with SSL/TLS (e.g. nginx) one can use a ...
Ben Richard's user avatar
  • 3,506
132 votes
4 answers
117k 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 ...
user avatar
109 votes
6 answers
32k views

Why can't I MitM a Diffie-Hellman key exchange?

After reading the selected answer of "Diffie-Hellman Key Exchange" in plain English 5 times I can't, for the life of me, understand how it protects me from a MitM attack. Given the ...
orokusaki's user avatar
  • 1,352
85 votes
4 answers
56k views

What is Logjam and how do I prevent it?

I heard there is a "new" TLS vulnerability named Logjam, what does it do and how do I prevent it?
Arperum's user avatar
  • 941
75 votes
2 answers
100k views

Diffie Hellman parameters still calculating after 24 hours

I have a fresh install of Arch Linux on a RaspberryPi model B. I'm setting up OpenVPN and using easy-rsa with OpenSSL 1.0.2d to generate initial keys and certificates. All went fine until I ran ./...
kgizdov's user avatar
  • 873
56 votes
2 answers
81k 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 ...
Kalai's user avatar
  • 811
49 votes
4 answers
8k views

Why is key exchange necessary at all?

Let's say "Alice" and "Bob" want to communicate with each other over an insecure network. Using Diffie–Hellman key exchange, they can get the same symmetric key at last. However, as I understand, ...
Firegun's user avatar
  • 503
47 votes
2 answers
77k 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 does ...
David Halter's user avatar
42 votes
6 answers
87k views

What is the simplest safe way to convey a password to another person? [duplicate]

What is the easiest way for two people – neither of whom are computer specialists and cannot meet in person – to send a password for an encrypted file that is attached to an email? The two simplest ...
Peter's user avatar
  • 1,007
37 votes
4 answers
31k views

Can someone explain 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); ...
Steven Lu's user avatar
  • 977
34 votes
2 answers
15k views

What is the current security status of Diffie-Hellman key exchange?

There is a web site weakdh.org, whose name alone would certainly cause some feeling of uncertainty in using DH among people who are not experts IMHO. Could some knowledgeable person kindly say ...
Mok-Kong Shen's user avatar
32 votes
2 answers
33k views

Extract pre-master keys from an OpenSSL application

Consider an application using OpenSSL which has a bug. A packet capture of the full SSL session is available, as well as a core dump and debugging symbols for the application and libraries. A RSA ...
Lekensteyn's user avatar
  • 6,078
30 votes
3 answers
38k views

How to check if a server is not vulnerable to Logjam?

In response to Logjam I want to prove I've hardened my services. I know that the DH param has to be 2048 bits at least and self generated. But I am unable to find a way to actually check this for ...
LvB's user avatar
  • 8,833
28 votes
1 answer
22k views

How does SSH use both RSA and Diffie-Hellman?

SSH protocol 2 allows you to use DSA, ECDSA, ED25519 and RSA keys when establishing a secure connection to a server. (Keep in mind for this question that I'm only familiar with the procedure and ...
IQAndreas's user avatar
  • 6,775
27 votes
2 answers
26k 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 ...
gertvdijk's user avatar
  • 373
27 votes
3 answers
12k 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 ...
Polynomial's user avatar
  • 135k
25 votes
1 answer
15k views

Relationship between RSA, Diffie-Hellman Key Exchange, PKI and X.509?

I am getting confused with RSA, Diffie-Hellman Key Exchange, PKI and X.509v3. I took a look of RSA's mathematics algorithm, it seems like a encryption algorithm, right? Generating public key and ...
alcohol menthol's user avatar
23 votes
2 answers
40k 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 Web browser (Firefox) I saw the following: Connection encrypted: High-grade Encryption (...
VL-80's user avatar
  • 1,234
23 votes
2 answers
24k views

What is the difference between DH and DHE?

I have been reading Bulletproof SSL and TLS Diffie Hellman is a key exchange mechanism, in which each of server and client share secret i.e. gx and gy respectively with each other where g is ...
prakharjain's user avatar
23 votes
2 answers
4k views

Why is Mozilla recommending predefined DHE groups?

In a revision dated 2016-10-31, Mozilla changed their Server Side TLS recommendation from generating a random DH group to the ones published in RFC 7919. Mozilla claims: These groups are audited and ...
willwill's user avatar
  • 505
20 votes
2 answers
23k 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 ...
Zoredache's user avatar
  • 653
20 votes
2 answers
34k 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 ...
Matthew Clenney's user avatar
19 votes
1 answer
8k 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 ...
Nicholas Wilson's user avatar
18 votes
2 answers
20k 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 ...
Naftuli Kay's user avatar
  • 6,753
15 votes
3 answers
10k views

Is 8192 Diffie-Hellman overkill?

I've finally ran SSL server test on my server and was presented with: This server supports weak Diffie-Hellman (DH) key exchange parameters. Grade capped to B. So I tried to generate stronger ...
graywolf's user avatar
  • 405
15 votes
4 answers
13k views

What is the role of RSA in ECDHE-RSA? [duplicate]

I have read some textbooks and not found a convincing explanation. In the cipher suite ECDHE-RSA-AES128-GCM-SHA256, what is the role of RSA in the first part (ECDHE-RSA)? This part of the cipher ...
Johnny Willer's user avatar
15 votes
1 answer
13k views

What are the OpenSSL standard Diffie-Hellman parameters (primes)?

I recently generated some custom Diffie-Hellman 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 ...
binaryanomaly's user avatar
12 votes
1 answer
9k views

When exactly is Diffie-Hellman used in TLS?

I'm aware that Diffie-Hellman is a key exchange algorithm whereas RSA is an asymmetric encryption algorithm. I have the following questions: During TLS handshake, will both RSA and DH be used? (I ...
Vinod Pn's user avatar
  • 385
12 votes
2 answers
16k views

which diffie-hellman group is needed for secure ike/ipsec

We're deploying ipsec on embedded devices and getting catastrophic performance from the diffie hellman 2048 group in ike.. afterwards the shared securet is used for 3des, sha1. ipsec negiation is ...
dancl's user avatar
  • 223
11 votes
2 answers
16k 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 ...
safsaf32's user avatar
  • 213
11 votes
3 answers
2k views

What DH Group size do TLS Ephemeral DHE ciphers use?

In SSL/TLS, the Client and the Server have the option to use an Ephemeral Diffie-Hellman exchange to establish a shared secret for which to seed the ensuing Master Secret and Session keys. In the ...
Eddie's user avatar
  • 771
11 votes
1 answer
733 views

Diffie-Hellman large prime number weakness. Is this concept valid? If so, how can this be remediated by end-users/admins?

So I saw this blog post on “How is NSA breaking so much crypto?”. The basic idea of this blog post is this: There is an inherent weakness in Diffie-Hellman that stems from services using the same ...
Giacomo1968's user avatar
  • 1,184
10 votes
2 answers
30k 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 ...
Zack's user avatar
  • 101
10 votes
4 answers
37k views

Diffie Hellman Group Matching to IPSec Encryption Algorithm

I'm looking for help determining acceptable Diffie Hellman (DH) Groups for specific IPSec IKE and ESP Encryption Algorithms. The goal is to choose DH groups that provide adequate protection for the ...
Mister_Tom's user avatar
10 votes
2 answers
8k views

In Ephemeral Diffie Hellman Key Exchange - what is actually ephemeral?

Just starting to learn about Diffie-Hellman, and it seems simple enough, but I am struggling to find any resources that explain in an Ephemeral Diffie Hellman Key Exchange, what it is that is actually ...
stats_novice_123's user avatar
10 votes
1 answer
2k views

Why does TLS 1.3 deprecate custom DHE groups?

According to the second draft of the TLS 1.3 specification, custom DH groups have been deprecated. As we all know, hardcoded DH groups are vulnerable to a precomputation attack that allows retroactive ...
forest's user avatar
  • 66.5k
10 votes
3 answers
2k views

Is ECDH for SEC P-384 and P-521 broken in Windows 10 / Windows Server 2016 TP3?

UPDATE: Proof of concept code here, console output shown below and all involved certificates are here. Just noticed that ECDiffieHellmanCng.DeriveKeyMaterial(...) behaves differently on Windows 8.1 ...
DeepSpace101's user avatar
  • 2,183
9 votes
1 answer
16k views

Authenticated Diffie Hellman Key Exchange

It appears that the textbook version of Diffie-Hellman is susceptible to man in the middle attack and the use of digital signatures could prevent this attack from occurring. Digital signatures could ...
Computernerd's user avatar
  • 2,421
9 votes
2 answers
5k 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 ...
Lekensteyn's user avatar
  • 6,078
9 votes
2 answers
18k 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 ...
D_E_M's user avatar
  • 93
9 votes
1 answer
10k views

How does TLS work (RSA, Diffie-Hellman, PFS)?

I know "How TLS works" has been discussed numerous times here and crypto, but I am still somewhat confused and would like to summarize what I know so far 1 in this giant blob of text with ...
CppLearner's user avatar
9 votes
2 answers
7k views

Does public key auth in SSH prevent most MITM attacks?

I found this article that claims asymmetric crypto signature of DH-obtained key prevents MITM: http://www.gremwell.com/ssh-mitm-public-key-authentication Key idea: The value of 'signature' is a ...
wtfantastic's user avatar
8 votes
1 answer
1k views

Do Diffie-Hellman parameters need to be recreated regularly?

Having generated 2048-bit DH params, do I need to regenerate them regularly? If so, how frequently should I do this?
Roger Lipscombe's user avatar
8 votes
2 answers
9k 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 ...
Hello World's user avatar
7 votes
3 answers
2k views

Usage of Ephemeral Diffie-Hellman ciphers in 2015 and beyond

In determining TLS standards for my company, I have come to wonder why all recommendations still suggest the use of the Ephemeral Diffie-Hellman TLS ciphers starting in TLS_DHE_xxx Background and ...
Tom17's user avatar
  • 171
7 votes
1 answer
3k views

Diffie Hellman Key Exchange in a messaging application

I'm currently a student that is trying to develop a messaging application on android using java that will implement diffie hellman key exchange in order to ensure that they both will be able to ...
hongster32's user avatar
6 votes
2 answers
2k views

Diffie-Hellman with non-prime modulus

When using the Diffie-Hellman key-exchange, it is said to be important to use a safe prime. However, if a non-prime modulus with sufficient bit-length is generated, is there an attack that can be used ...
Infuzion's user avatar
  • 172
6 votes
1 answer
16k views

In OpenVPN, is the dh1024.pem file dependent on the CA?

As the question already states, I'd like to know if the dh1024.pem file, generated by ./build-dh in openvpn, is dependent on the ca.(crt|key) file. The reason was that I needed to ./clear-all the ...
Daniel F's user avatar
  • 182
6 votes
1 answer
1k views

Online Diffie-Hellman Tool

I stumbled upon this website which provides a service to generate Diffie-Hellman parameters online for free to the public. Surely using a website like this would be a bad idea to use in a production ...
Tachyon's user avatar
  • 213

1
2 3 4 5 6