Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [diffie-hellman]

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

1
vote
2answers
46 views

How is Diffie Helman secure when the exchanged number is a power of the generator less than the modulo

I'm trying to understand how Diffie Helman is still secure when $A$ ends up being a power of $g$ less than $p$. I chose $p$, where p is prime, and $g$ is a primitive root modulo $p$. $g=2$ and $p=...
0
votes
1answer
32 views

Collisions in Diffie-Hellman private keys

Given a generator $g$, a large, safe prime $P$ and a result of the DH key exchange $g^{xy} \mod P$, how would I come up with two different $x', y'$ s.t. $g^{x'y'} = g^{xy} \mod P$
1
vote
1answer
36 views

Why does DH-EKE require that public keys be indistinguishable from random?

The introduction to SPAKE pre-authentication states: Diffie-Hellman Encrypted Key Exchange (DH-EKE) is the earliest widely deployed PAKE. It works by encrypting the public keys of a Diffie-Hellman ...
0
votes
0answers
19 views

Would a open decentralized blockchain network face any challenges like scalability and security? [closed]

If someone uses a decentralized open network for collecting data and allowing others to see it, would that sacrifice anything in terms of scalability or security for a protocol; for example IOT ...
1
vote
1answer
42 views

Problem on Elliptic Curve Point Doubling

Given an elliptical curve e.g. from “Understanding Cryptography” by Parr & Pelzl §9.2 Example 9.5: $y^2 = x^3 + 2x + 2~~~~ mod~17$ And given a primitive $P = (5, 1)$, the book indicates: We ...
0
votes
0answers
31 views

Using WebCrypto to generate ECDH key from PBKDF2 [migrated]

I want to take a secret and generate a ECDH public/private key from it. In the browser, a usual way would be to use PBKDF2 (or other deterministic bytes) to generate an ECDH public/private key pair ...
0
votes
0answers
34 views

Is a Diffie-Hellman shared secret with a private and public key from the same ECSDA pair considered less secure? [duplicate]

If I generate two public / private key pairs using ECDSA - pair A and pair B. Using Diffie-Hellman, a shared secret X is generated using the public key from pair A as the public base and the private ...
0
votes
1answer
38 views

Why does the Node crypto library do Diffie Hellman this way?

I was sifting through the Node Crytpo library and I came across their Diffie Hellman utility class. Their class implements a generateKeys function that, in their ...
0
votes
1answer
26 views

Shamir Secret Sharing and Diffie-Hellman procedure

Alice needs to share an already generated numeric secret $s$ with Bob and she doe not want the world to see it. The problem is that she has never contacted Bob before. I thought Alice and Bob could ...
3
votes
2answers
629 views

Is RSA inspired by Diffie Hellman?

I read a bit of A Method for Obtaining Digital Signatures and Public-Key Cryptosystems that introduced RSA in 1977, and, while learning the steps in RSA a few days ago, I noticed that they are similar ...
0
votes
1answer
70 views

How to encrypt plain-text message using Diffie-Hellman algorithm

Let's say bob says Hi and Alice says Hello, With the knowledge of n and ...
2
votes
1answer
92 views

Solving discrete log in partially known group

Suppose I have a group $G$ of unknown order $n$ where $n=p^k\cdot s$, $\gcd(p,s)=1$, $p$ is a known prime, $k,s$ are unknown positive integers and $k,s\ge1$. (Known - $p$ and $p\mid n$, Unknown - $n,k,...
0
votes
0answers
31 views

MTI authenticated key exchange protocol and their vulnerabilities?

Can someone please explain the different MTI key exchange protocols (A0, B0, C0, C1) and their vulnerabilities. I've been trying to read about them but couldn't get much information.
0
votes
1answer
52 views

Choosing good entropy $g$ and $p$ for a classic Diffie-Hellman Key exchange

When selecting $$g and $p$ for the Diffie-Hellman modular exponentiation: $ s= g^x \bmod p $ Which pairs of $g$ and $p$ are considered good nowadays, are recommended by bibliography? What I try ...
2
votes
1answer
63 views

Detect MITM with hashed session-key — Is my protocol secure?

I have the following setup: An app ("client") wants to communicate securely with a device I created ("server"). The client has the public key of the server (and a hashed password) preinstalled. I use ...
0
votes
0answers
31 views

Does repeated hashing preserve randomness?

Let's say I have 512 bytes of truly random data, but I want a lot more. If I take 512 bits, split it into two parts each with 256 bits, and run each of those through a 512 bit hashing function (say ...
0
votes
4answers
83 views

Diffie-Hellman key exchange: Why is $(g^{k_1} \bmod n )^{k_2} \bmod n \equiv (g^{k_2} \mod n)^{k_1} \bmod n$

In a Diffie-Hellman key exchange, with a generator $g$ and a modulo $n$, and two keys $k_1$ and $k_2$, why is $(g^{k_1} \bmod n )^{k_2} \bmod n \equiv (g^{k_2} \mod n)^{k_1} \bmod n$
1
vote
0answers
33 views

Can I use NaCl's scalar multiplication functions for Diffie Hellman Key Agreement?

I want to create some software that performs diffie hellman group key agreement but I don't want to reinvent the wheel even if I know how it's done. So I came accross the NaCl library, especially the <...
2
votes
1answer
60 views

How to handle a lost key in Diffie-Hellman Key Exchange

I implemented the Diffie-Hellman Key Exchange algorithm but, I was wondering how to handle if one of the parties lost his key. Let's take a chat app as an example, Bob and Alice they used to have a ...
2
votes
0answers
39 views

Reduction from integer factoring to computational Diffie Hellman

The computational Diffie Hellman (CDH) problem for ${\mathbb{Z}}^*_p$ is given a prime $p$, a generator $g$ of ${\mathbb{Z}}^*_p$, and a pair $(g^i, g^j)$ to compute $g^{ij}$. The value $g$ is called ...
1
vote
2answers
104 views

In the Diffie Hellman Key exchange, why is a value of $a=\frac{p-1}{2}$ a bad choice?

In Diffie Hellman key exchange, we have a large prime $p$ and non zero residue class $g \in F_p^x$ with a large order. An $a$ and $b$ are chosen in secret, and those are used to compute $A \equiv g^a ...
1
vote
1answer
77 views

How Elliptic-Curve affects the Server Key Exchange parameters

In Finite Field DHE, the server sends the following parameters in the server key exchange message: $p$: prime $g$: group $g^b$: the server's public DH key In DHE_RSA (non anonymous DHE), the server ...
2
votes
1answer
73 views

Does this scheme break under a DHP adversary?

Consider the following cryptography scheme: We are given a prime $p$. Alice wants to send the plaintext $m \pmod p$ to Bob. Alice chooses $a$ s.t. $\text{gcd}(a,p-1)=1$, and sends Bob, $u = m^a \...
2
votes
1answer
97 views

Restoring a point on an elliptic curve

I received a representation of a point on an elliptic curve $GF(2^m)$ (with curve coefficient A, B) in specific format and some description how to decode it but not all is clear to me. I would be ...
1
vote
2answers
88 views

How to calculate Trace function for a point on an elliptic curve

I encountered trouble with calculating Tr (trace function) for points on an elliptic curve in polynomial basis ( $GF(2^m), m = 431$). Maybe there are any assumptions that can simplify and allow ...
1
vote
1answer
118 views

Signal Protocol: What extra features does double ratchet algorithm add to Diffie-Hellman ratchet?

I have been reading the documentation of Signal protocol and could not find out why they came up with double ratchet instead of using Diffie-Hellman ratchet which was available at first place in OTR?
0
votes
1answer
70 views

Tls protocols: is the simple diffie hellman key exchange still used these days?

Or did it mostly get replaced by ecdh for key exchange and rsa for authentication ?
1
vote
2answers
132 views

Point of Diffie-Hellman key exchange when public keys are known [duplicate]

Since the basic version of Diffie-Hellman key exchange protocol is vulnerable to Man In The Middle Attack, some sort of authentication is needed. It was mentioned that RSA digital signature can be ...
2
votes
0answers
40 views

Is my way safe to remove SSL CA Cert by DHT and PoW NodeID for a decentralized system?

To implement a decentralized system, I wrote a TLS like P2P net stack. The main idea is removing CA Cert from the whole system by using a DHT for Naming and Key Exchange. I am not a crypto expert, so ...
1
vote
2answers
81 views

Multiparty key exchange for end-to-end encryption

I need to make end-to-end encrypted messaging between 2 and more parties without trusting a server. Each party has it's secret and private keys. The obvious solution is to make ECDH between all of ...
-1
votes
1answer
40 views

Question About ECC Primitives (GnuPG)

In version 2.1, GnuPG featured primitives that use elliptic curves. For encryption, one option was ECDH, which confused me. I thought ECDH was for key agreement, not public key encryption. How does ...
2
votes
2answers
80 views

Why would Diffie-Hellman Group 21 be 521 bits rather than 512?

Diffie-Hellman groups tend to increment in key sizes as you'd expect up until group 21. Any idea why the key size is 521 rather than 512? I haven't been able to find an answer at all.
-1
votes
1answer
65 views

Is this problem still as hard as discrete logarithm (modified ElGamal)?

I am trying to find a vulnerability or proof for the following problem: ElGamal part. Given $g\in\mathbb Z_p$ where $g$ generates $\mathbb Z_p^\star$, select randomly $k\in\mathbb Z_p$ and calculate ...
1
vote
0answers
67 views

Multi-Party Offline Key Exchange Using Public and Private Keys

I hope the title already explains the problem I have in mind; but let me lay out some more details. Given public-private key pairs $P_A, P_B, P_C, ... P_Z$, (first $3$ of which are owned by our usual ...
3
votes
0answers
45 views

How to see Diffie Hellman private key used during negotiation? [closed]

I used OpenSSL s_client to connect to a test server. Because OpenSSL generated client side private DH key, I think there will be a way to show the private key or ...
1
vote
1answer
62 views

What are the differences between ephemeral-static ECDH and static-static ECDH?

As I know ECDH can be used with a fixed public key. I read there are two types of static ECDH, ephemeral-static ECDH, and static-static ECDH. What are the differences between these two types?
1
vote
2answers
61 views

powers of g in $GF(256)$

The finite field $GF(256)$ is usually implemented $mod$ 0x11b to keep the numbers inside that field. I understand that 0x11b was ...
0
votes
1answer
62 views

How do i generate the shared key from this question?

Say I have Alice and Bob: Alice has $XA$, $YA = g^{XA} \bmod P$, $RA$ (random number) Bob has $XB$, $YB = g^{XB} \bmod P$, $RB$ (random number) Assume they have exchanged their certificates and ...
2
votes
0answers
56 views

How many qbits are required to break Diffie-Hellman over a multiplicative group

There have been comparisons between RSA and ECDH with regards to the number of qbits (qubits) required to break the algorithm with a specific key size. But how many qbits are required to break "...
0
votes
2answers
50 views

Good Diffie Hellman Encryption Method

I've just made my own implementation of Diffie Hellman in nodejs (its for a project of mine). However the shared keys are integers, I want to use those integers as a key to encrypt data. This is an ...
2
votes
2answers
373 views

AES and ECDH key

I am trying to understand public key encryption. I found the table below in a paper online. I am struggling to understand the meaning of this. From the bits and pieces read, I am tempted to think that ...
1
vote
0answers
55 views

Securing MQTT communication

I am building kinda simple IoT project, but I would like to implement good security (just for educational purposes and fun). My plan is to build simple solution where one arduino board reads some data ...
1
vote
0answers
121 views

ECC Curve25519: How to generate this kind of private key? / Strange key exchange mechanism

I'm currently reverse engineering a program that uses Curve25519 key exchange in network communication. I have only a basic understanding of ECC, so maybe this thing just seems strange to me. The ...
2
votes
1answer
114 views

The compression of the eliptic curve point coordinates

Some time ago I faced the problem of the unexpected format compression of the points on elliptic curve. I used ECDH procedure with a third party service on the base of the $\mathbb({F}_{2^m})$ curve ...
-2
votes
1answer
45 views

Diffie Hellman Key Exchange Security wrt the hardness of discrete Logarithm

Hi I am very new to this field and I was wondering how one would prove or disprove the following statements: 1) if the DH key exchange protocol is secure for a finite cyclic group G, then computing ...
1
vote
0answers
26 views

GPG encrypt performance degradence for thousands receipients

I plan to use GPG to encrypt a small file (32KB) for very many recipient public keys (few thousands). I tested GPG with RSA and then ECDH public key encryptions. If RSA is very slow, with ECDH (nist ...
1
vote
2answers
185 views

Are there benefits for using Static Diffie-Hellman over Ephemeral Diffie-Hellman?

TL;DR - Are there any benefits to using static DH over ephemeral DH? I'm reading about the differences between static DH & ephemeral DH and I am trying to think of one logical reason to use ...
0
votes
0answers
41 views

What protocols are secure under computational and decisional diffie hellman assumption respectively?

I am new to crypto, and I have read the definitions of Computational Diffie-Hellman(CDH) and Decisional Diffie-Hellman(DDH) assumption, though I tried to figure out the differences between the two ...
2
votes
1answer
134 views

Finding missing bits mathematicaly in a DLP situation (full problem)

In a preparatory question we had to recover decimal digits $@$ of $r$ and $s$ given $g=51234$, $h=90403$, $N=111649$, $r=3@497$, $s=276@3$, with $r$ and $s$ the smallest positive solutions to $g^r\...
2
votes
1answer
98 views

Finding missing bits mathematicaly in a DLP situation

Here is a DLP exercice $g = 51234,\; h = 90403 ,\; N = 311 \cdot 359 = 111649$. Define $r$ as the smallest positive integer with $g^r \equiv h \pmod N$. Define $s$ as the smallest positive integer ...