Aller au contenu
ecdsa.com

Elliptic Curve Playground — explorateur interactif de courbes elliptiques

Chaque clé ECDSA se résume à un scalaire et à une addition de points, répétée. Ici, la même arithmétique s’effectue sur un corps assez petit pour être dessiné : choisissez une courbe, additionnez des points, faites glisser k et regardez kG sauter d’un point à l’autre, puis voyez pourquoi le calcul inverse est la partie difficile.

100 % local : tout s’exécute dans votre navigateur, rien n’est envoyé à aucun serveur

Assez grande pour que le nuage de points ne ressemble plus à un motif, assez petite pour qu’une recherche complète ne prenne que quelques dizaines d’étapes. Ses 100 points ne forment pas un cycle unique : la plus longue suite qu’un générateur produise ici est de 50.

y² = x³ + 2x + 3 sur F₉₇ : tracé de tous les points

00101020203030404050506060707080809090y = p/2 · miroir : P ↔ −PG(0, 10)(0, 87)(1, 43)(1, 54)(3, 6)(3, 91)(4, 47)(4, 50)(10, 21)(10, 76)(11, 17)(11, 80)(12, 3)(12, 94)(17, 10)(17, 87)(20, 34)(20, 63)(21, 24)(21, 73)(22, 5)(22, 92)(23, 24)(23, 73)(24, 2)(24, 95)(25, 35)(25, 62)(27, 7)(27, 90)(28, 34)(28, 63)(29, 43)(29, 54)(30, 0)(32, 7)(32, 90)(37, 22)(37, 75)(38, 7)(38, 90)(39, 6)(39, 91)(44, 20)(44, 77)(46, 25)(46, 72)(47, 18)(47, 79)(49, 34)(49, 63)(50, 19)(50, 78)(52, 29)(52, 68)(53, 24)(53, 73)(54, 12)(54, 85)(55, 6)(55, 91)(56, 8)(56, 89)(59, 32)(59, 65)(65, 32)(65, 65)(67, 43)(67, 54)(68, 0)(70, 32)(70, 65)(73, 14)(73, 83)(74, 20)(74, 77)(76, 20)(76, 77)(80, 10)(80, 87)(83, 23)(83, 74)(84, 37)(84, 60)(85, 26)(85, 71)(86, 28)(86, 69)(87, 27)(87, 70)(88, 41)(88, 56)(91, 39)(91, 58)(92, 16)(92, 81)(95, 31)(95, 66)(96, 0)

Cliquez sur un point pour en faire le générateur G. La ligne pointillée est y = p/2 : chaque point a un symétrique par rapport à elle, et ce symétrique est son opposé −P. Les points où y = 0, sur la rangée du bas, n’ont pas de symétrique : chacun est son propre opposé.

Générateur et scalaire

k : le scalaire1 … 50
1

1G = 1 × (0, 10)

(0, 10)

Points de la courbe
100 en comptant O (99 points affines + le point à l’infini)
Vérification de Hasse
p + 1 = 98, donc #E doit être compris dans [79, 117] ; valeur trouvée : 100 ✓
Ordre de G
50 (50G = O) : G atteint 50 des 100 points, soit un sous-groupe
Bouclage
50G = O, donc (50 + 1)G = G : la suite se répète indéfiniment

Le calcul direct est peu coûteux : doubler-et-additionner

Personne ne calcule 1G en additionnant G à lui-même 0 fois. Écrivez k en binaire : il suffit alors d’un doublement par bit, plus une addition par bit à 1. C’est l’idée de toute implémentation d’ECDSA, qui y ajoute ensuite le fenêtrage et un traitement en temps constant.

k = 1 en binaire
1₂ (1 bit)
Doubler-et-additionner
0 doublement + 0 addition = 0 opération sur les points
Boucle naïve
0 addition
secp256k1
un k de 256 bits coûte au plus 255 doublements + 255 additions : quelques microsecondes seulement

Le calcul inverse est la partie difficile

La question inverse (trouver k à partir de G et de 1G) est le problème du logarithme discret sur les courbes elliptiques. Sur une courbe aussi petite, ce n’est pas un problème du tout : il suffit de parcourir la suite.

Recherche exhaustive ici
k = 1, trouvé après 1 addition (au plus 50 sur cette courbe)
Meilleure méthode générique
rho de Pollard : environ √50 ≈ 7 opérations, une simple erreur d’arrondi à cette échelle
Même méthode, secp256k1
√n ≈ 2¹²⁸ ≈ 3,4 · 10³⁸ opérations

Tout tient dans ce dernier nombre. À raison de 10⁹ opérations sur la courbe par seconde et par machine, 10⁹ machines travaillant en parallèle auraient encore besoin d’environ 10¹³ ans, soit plusieurs centaines de fois l’âge actuel de l’univers. Aucun algorithme général plus rapide contre une courbe bien choisie n’est connu publiquement ; c’est sur cette hypothèse, et non sur un quelconque secret des formules, que repose une clé ECDSA.

From the playground to a real key

Nothing changes between this page and a production key except the size of the numbers. secp256k1 — the curve behind Bitcoin and Ethereum — is y² = x³ + 7, the same equation as the mini-curve above, over a prime just under 2²⁵⁶ instead of 127. P-256, the curve in most TLS certificates and passkeys, is y² = x³ − 3x + b over a different 256-bit prime. Both have a published generator point G and a group order n of about 2²⁵⁶.

A key pair is exactly the two things the Scalar multiplication tab shows. The private key is the scalar k: a random integer in 1 … n − 1. The public key is the point kG: the generator added to itself k times, computed by the same double-and-add ladder, about 256 doublings and a couple of hundred additions. Publishing kG reveals nothing usable about k for the same reason the slider does not — the only known way back is to search, and the search space is the size of the group.

Signing adds one more scalar: a per-signature nonce, multiplied by G to produce r, with s tying the message hash and the private key together. That is why nonce handling is the sharp edge of ECDSA — the arithmetic on this page is unforgiving of a repeated random value. Generate real key pairs and signatures with the Test Vector Generator, or read how this compares with the factoring problem in ECDSA vs RSA.

How it works

The playground enumerates every solution of y² = x³ + ax + b modulo a small prime p by squaring each field element once and matching the results against the right-hand side — a few thousand operations, which is why the plot appears instantly and why the same approach is hopeless for a 256-bit prime. Point addition uses the standard chord-and-tangent formulas with a modular inverse computed by the extended Euclidean algorithm, and kG uses double-and-add, the same ladder a real signing routine walks.

Two sanity checks run on the arithmetic itself: the number of points found always lands inside the interval Hasse's theorem allows around p + 1, and the order of every point divides the group order, as Lagrange requires. The real-number tab draws the identical formulas with ordinary floating-point math, which is only ever a teaching aid — cryptography needs the exactness of integers modulo a prime. Everything is computed locally in your browser; the page makes no network requests and has no inputs worth keeping.