Laboratório de curvas elípticas (Elliptic Curve Playground)
Toda chave ECDSA se resume a um escalar e a uma adição de pontos repetida. Aqui, a mesma aritmética roda sobre um campo pequeno o bastante para ser desenhado: escolha uma curva, some pontos, deslize k e veja kG saltar de um lado para o outro — depois, veja por que fazer esse caminho ao contrário é a parte difícil.
100% local — tudo roda no seu navegador, nada é enviado a nenhum servidor
Grande o bastante para que a nuvem de pontos deixe de parecer um padrão, pequena o bastante para que uma busca completa leve algumas dezenas de passos. Os 100 pontos dela não formam um único ciclo — a sequência mais longa que um gerador produz aqui tem 50.
y² = x³ + 2x + 3 sobre F₉₇ — todos os pontos, plotados
Clique em qualquer ponto para torná-lo o gerador G. A reta tracejada é y = p/2: todo ponto tem um par espelhado em relação a ela, e esse par é o seu negativo −P. Os pontos com y = 0, na fileira de baixo, não têm par: cada um é o seu próprio negativo.
Gerador e escalar
1G = 1 × (0, 10)
(0, 10)
Calcular para a frente é barato: double-and-add
Ninguém calcula 1G somando G a si mesmo 0 vez. Escreva k em binário e você só precisa de uma duplicação por bit, mais uma adição para cada bit 1 — a ideia por trás de toda implementação de ECDSA, que ainda acrescenta janelas (windowing) e tratamento em tempo constante.
O caminho de volta é a parte difícil
A pergunta inversa — dados G e 1G, encontrar k — é o problema do logaritmo discreto em curvas elípticas. Numa curva tão pequena, isso não é problema nenhum: basta percorrer a sequência.
Esse último número é o que importa. Uma máquina que faz 10⁹ operações de curva por segundo, replicada em 10⁹ máquinas em paralelo, ainda levaria cerca de 10¹³ anos — várias centenas de vezes a idade atual do universo. Não se conhece publicamente nenhum algoritmo geral mais rápido contra uma curva bem escolhida; é nessa suposição, e não em algum segredo nas fórmulas, que uma chave ECDSA se apoia.
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.