main
sudo pacman -Syu 2024-07-30 01:36:21 +07:00
parent 11e20c5a6a
commit cca8f4640e
2 changed files with 46 additions and 2 deletions

View File

@ -355,7 +355,39 @@
<li>
Alice and Bob exchange <code>A</code> and <code>B</code>
<ul>
<li>Same secret <code>A^b mod p == B^a mod p</code></li>
<li>
Same secret <code>A^b mod p == B^a mod p == g^(ab) mod p</code>
</li>
</ul>
</li>
</ul>
<p>Diffie-Hellman is based on group theory.</p>
<div class="markdown-heading">
<h2 class="heading-element">Elliptic Curve Diffie-Hellman (ECDH)</h2>
<a
id="user-content-elliptic-curve-diffie-hellman-ecdh"
class="anchor"
aria-label="Permalink: Elliptic Curve Diffie-Hellman (ECDH)"
href="#elliptic-curve-diffie-hellman-ecdh"
><span aria-hidden="true" class="octicon octicon-link"></span
></a>
</div>
<p>Instead of prime number, use elliptic curve.</p>
<ul>
<li>
Alice and Bob agree on elliptic curve <code>E</code> and generator
<code>G</code>.
</li>
<li>
Alice generate secret <code>a</code> and public <code>A = [a]G</code>.
</li>
<li>
Bob generate secret <code>b</code> and public <code>B = [b]G</code>.
</li>
<li>
Alice and Bob exchange <code>A</code> and <code>B</code>
<ul>
<li>Same secret <code>[a]B == [b]A == [ab]G</code></li>
</ul>
</li>
</ul>

View File

@ -188,4 +188,16 @@ public_key then it's over.
- Alice generate secret `a` and public `A = g^a mod p`.
- Bob generate secret `b` and public `B = g^b mod p`.
- Alice and Bob exchange `A` and `B`
- Same secret `A^b mod p == B^a mod p`
- Same secret `A^b mod p == B^a mod p == g^(ab) mod p`
Diffie-Hellman is based on group theory.
## Elliptic Curve Diffie-Hellman (ECDH)
Instead of prime number, use elliptic curve.
- Alice and Bob agree on elliptic curve `E` and generator `G`.
- Alice generate secret `a` and public `A = [a]G`.
- Bob generate secret `b` and public `B = [b]G`.
- Alice and Bob exchange `A` and `B`
- Same secret `[a]B == [b]A == [ab]G`