| Home Page |
| Course Page |
| y = x3 | y2 = x3 | a = 0, b = 0 | |
![]() |
![]() |
| y = x3 − 2x | y2 = x3 − 2x | a = −2, b = 0 | |
![]() |
![]() |
| y = x3 − 2x + 2 | y2 = x3 − 2x + 2 | a = −2, b = 2 | |
![]() |
![]() |
![]() |
![]() |
3.1. Set λ ← (y0 − y1)/(x0 − x1) mod p.
3.2. Go to Step 7.
| y | y2 | y | y2 | y | y2 | y | y2 | |||||||||||
| 0 | 0 | 5 | 6 | 10 | 5 | 15 | 16 | |||||||||||
| 1 | 1 | 6 | 17 | 11 | 7 | 16 | 9 | |||||||||||
| 2 | 4 | 7 | 11 | 12 | 11 | 17 | 4 | |||||||||||
| 3 | 9 | 8 | 7 | 13 | 17 | 18 | 1 | |||||||||||
| 4 | 16 | 9 | 5 | 14 | 6 |
| x | z | Square? | x | z | Square? | x | z | Square? | x | z | Square? | ||||||||||||
| 0 | 7 | Yes | 5 | 5 | Yes | 10 | 12 | - | 15 | 18 | - | ||||||||||||
| 1 | 13 | - | 6 | 6 | Yes | 11 | 6 | Yes | 16 | 3 | - | ||||||||||||
| 2 | 6 | Yes | 7 | 5 | Yes | 12 | 9 | Yes | 17 | 8 | - | ||||||||||||
| 3 | 11 | Yes | 8 | 8 | - | 13 | 8 | - | 18 | 1 | Yes | ||||||||||||
| 4 | 15 | - | 9 | 2 | - | 14 | 9 | Yes |
| x | x−1 | x | x−1 | x | x−1 | x | x−1 | ||||||||
| 0 | - | 5 | 4 | 10 | 2 | 15 | 14 | ||||||||
| 1 | 1 | 6 | 16 | 11 | 7 | 16 | 6 | ||||||||
| 2 | 10 | 7 | 11 | 12 | 8 | 17 | 9 | ||||||||
| 3 | 13 | 8 | 12 | 13 | 3 | 18 | 18 | ||||||||
| 4 | 5 | 9 | 17 | 14 | 15 |
ELLIPTIC CURVE DIFFIE-HELLMAN KEY EXCHANGE DEMO
Elliptic curve: y^2 = x^3 + ax + b (mod p)
p = 6277101735386680763835789423207666416083908700390324961279
a = 6277101735386680763835789423207666416083908700390324961276
b = 2455155546008943817740293915197451784769108058161191238065
Generator of order n:
G = (602046282375688656758213480587526111916698976636884684818,
174050332293622031404857552280219410364023488927386650641)
n = 6277101735386680763835789423176059013767194773182842284081
Alice picks a secret random number u, 1 < u < n
u = 5637251092883050934974034135782244228141279863292549702928
Alice computes uG and sends uG to Bob
uG = (973697636141457729657017784410888711121134871939721243872,
5411673841953064524346212602751798888735083386815984546764)
Bob picks a secret random number v, 1 < v < n
v = 2839528846177866422846490458713234411077080637528653828732
Bob computes vG and sends vG to Alice
vG = (4308684260420081712899023104548395315152398734431254914227,
5763741726400787544768110819727646341738661500991689474804)
Alice receives vG from Bob and computes K1 = u(vG)
K1 = (4118877111827861632392671987908909928900571700854755697981,
3954628862413479499373206339481805439303476657793414035681)
Bob receives uG from Alice and computes K2 = v(uG)
K2 = (4118877111827861632392671987908909928900571700854755697981,
3954628862413479499373206339481805439303476657793414035681)
They match!
| Elliptic curve size n (bits) | Zp* size N (bits) | |
| 160 | 1024 | |
| 256 | 3072 | |
| 384 | 7680 | |
| 512 | 15360 |
| Course Page |
| Home Page |