165 votes
Accepted

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

Diffie-Hellman is a key exchange protocol but does nothing about authentication. There is a high-level, conceptual way to see that. In the world of computer networks and cryptography, all you can see,...
user avatar
  • 168k
157 votes

"Diffie-Hellman Key Exchange" in plain English

The other answers do an excellent job explaining the maths behind the key exchange. If you'd like a more pictorial representation, nothing beats the excellent paint analogy shown on the Diffie–Hellman ...
user avatar
  • 1,637
69 votes
Accepted

Is (safe) encryption over compromised line impossible?

If the attacker is only passively listening to the connection then Diffie Hellman Key Exchange can be done to create a common key known only to the communication peers. But, if the attacker can not ...
user avatar
58 votes

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

Tom has provided a good explanation as to why Diffie-Hellman cannot be safe against man-in-the-middling. Now this answers the OP's original question but probably leaves some readers with the (...
user avatar
  • 1,233
57 votes
Accepted

Why is key exchange necessary at all?

If the attacker is able to passively capture data and later gets access to the private key of the certificates (i.e. stealing, heartbleed attack or law enforcement), then the attacker could decode all ...
user avatar
31 votes
Accepted

How does SSH use both RSA and Diffie-Hellman?

The host key is used to sign the Diffie-Hellman parameters. It is used during the key exchange; RSA is a signature algorithm as well as an encryption algorithm. From what I can tell, the client key (...
user avatar
  • 7,133
30 votes
Accepted

Are there any systems out there that use a one-time pad?

The problem with a one time pad, is that is must be equal in length (or longer) than the data being encrypted , and must never, ever, be reused. Just as you indicate, how would they send the key?, ...
user avatar
28 votes
Accepted

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

Asymmetric Cryptography There are two different parts to creating a TLS session. There is the asymmetric cryptography, portion which is an exchange of public keys between two points. Which is what ...
user avatar
  • 12.2k
28 votes
Accepted

How can we exchange public keys between two servers in a secure way?

This will mean a lot of unneeded overhead. I'd suggest following: Since you don't have certificates issued by CA, create your own CA. Namely, create a self-signed certificate and add it to a key ...
user avatar
  • 7,896
26 votes

"Diffie-Hellman Key Exchange" in plain English

The key exchange problem A secure connection requires the exchange of keys. But the keys themselves would need to be transfered on a secure connection. There are two possible solution: exchange the ...
user avatar
  • 399
26 votes
Accepted

What to do when you can’t protect mobile app secret keys?

I think I can help resolve your concerns. So what are we trying to protect? We're trying to protect ourselves from an attacker breaking into user accounts via our web services. Specifically, how ...
user avatar
25 votes
Accepted

Are open wireless networks unencrypted?

Yep. Open wireless networks are entirely unencrypted; anyone can see all the data you send (even if they aren't connected to the network).
user avatar
  • 7,133
21 votes
Accepted

Are VPNS vulnerable to active man in the middle attacks?

In order to protect from a man-in-the-middle attack, at least one of the endpoints of the communication needs to have some prior knowledge about the other endpoint. It's usually up to the client to ...
user avatar
19 votes
Accepted

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

The behaviour of OpenSSL, as a library, is documented in the man page for SSL_CTX_set_tmp_dh_callback(). Basically, the library itself contains no pre-generated DH parameters and will refuse to do any ...
user avatar
  • 168k
19 votes

Are there any systems out there that use a one-time pad?

How would they pass they key? This gets to the root of where OTPs came from, and indeed how they got that name. This is for correspondence during wartime with ships or other similar agents[*]. When ...
user avatar
  • 81.9k
19 votes
Accepted

Authenticated Diffie Hellman Key Exchange

Your description is a bit confused and appears to be wrong. In particular, we see Alice computing here Diffie-Hellman half gKA and then proceed to send... her Diffie-Hellman secret KA to Bob, which is ...
user avatar
18 votes

Unseen.is encryption claims revisited with their proprietary, patented "xAES" algorithm

From what you describe, what they do is that they tunnel data in some SSL (this is reasonable) but add an extra encryption layer in Javascript (this is not reasonable). The whole reasoning is faulty. ...
user avatar
18 votes

Can a large corporation make a believable promise

However, if the third party makes a secret copy, then they can covertly sell it for large amounts of money. The thing about this is when it comes to a pivotal and highly-valued asset such as said key,...
user avatar
  • 1,668
17 votes

DEK, KEK and Master key - simple explanation

Secure Storage DEK: Data Encryption Key KEK: Key Encryption Key Master Key: Generally will describe one of the two above keys. Depending on the scheme in which it is implemented. This type of ...
user avatar
  • 12.2k
17 votes

Why is key exchange necessary at all?

There are many steps needed to understand the reasons and I will try to guide you through each. 1) Use encryption correctly... With RSA algorithm, Alice and Bob can just share their public keys (...
user avatar
  • 6,881
16 votes
Accepted

Can a large corporation make a believable promise

Companies make promises they can't renege on all the time - that's what a contract is. After all, insurance wouldn't exist if an insurer could wriggle out of paying claims through things like secret ...
user avatar
  • 415
13 votes

Are there any systems out there that use a one-time pad?

Not really "Internet", but the one-time pad is documented to have been used for the Red Phone (a westernly-biased name; I don't know how they called it in Moscow). The pads were exchanged on magnetic ...
user avatar
13 votes
Accepted

Forward secrecy with GnuPG

Is there anything like this? There is actually a draft specifically on doing this, titled Forward Secrecy Extensions for OpenPGP. The gist of the draft is that temporary keys must be created for each ...
user avatar
  • 64k
13 votes

How can we exchange public keys between two servers in a secure way?

No, I don't think that the solution is good. Let’s go through it: This is fine If we can manually copy, why not copy the public keys directly? Here's the real problem. As this is done on an insecure ...
user avatar
  • 29k
11 votes

"Diffie-Hellman Key Exchange" in plain English

Securing data as it passes through the internet usually requires protecting it in two ways: Confidentiality -- assuring no one except the intended recipients can read the data Integrity -- assuring ...
user avatar
  • 677
10 votes

Are open wireless networks unencrypted?

an open wireless connection means there is no password exchange required to connect to the network. most data used over an open wireless connection is easily observed. once connected however, there ...
user avatar
9 votes
Accepted

Diffie-Hellman key exchange

With big numbers, Diffie-Hellman looks like this: we work modulo a big prime p, and we start with a conventional big integer g (in the 2..p-2 range). Each integer modulo p represents an achieved ...
user avatar
9 votes

Is (safe) encryption over compromised line impossible?

There is indeed a solution to this problem! It's called the Diffie-Hellman Key Exchange protocol. You can read a good description at the wikipedia link, but the basic idea is that Alice and Bob each ...
user avatar
9 votes

SSH key based login is not vulenerable to MiTM attack. Is it true?

First, a man in the middle attack can neither happen with key based nor with password based authentication if the client properly authenticates the server. A man in the middle attack is possible if ...
user avatar
9 votes
Accepted

Why does TLS 1.3 deprecate custom DHE groups?

With TLS 1.2 the server first needed to tell the client within the ServerKeyExchange message about the parameters of the DHE group it supports. Only then the client could act on these. With TLS 1.3 ...
user avatar

Only top scored, non community-wiki answers of a minimum length are eligible