weakkey

package
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 21, 2026 License: BSD-3-Clause Imports: 4 Imported by: 0

Documentation

Overview

Package weakkey finds elliptic-curve public keys whose private scalar is tiny.

A public key Q on a curve with generator G is Q = k·G. If k is small, anyone can recover it by stepping through G, 2G, 3G, ... until they reach Q. The eMudhra intermediates compromised in October 2026 had k below 256. This package checks every k up to Limit, and also n-k (the same point negated), so the answer is a proof, not a heuristic: when it reports k, then k·G (or (n-k)·G) equals the key.

Index

Constants

View Source
const Limit = 1 << 16

Limit is the largest scalar checked. Recovering any k below it takes a laptop well under a second, so a key in this range is as good as public.

Variables

This section is empty.

Functions

func SmallScalar

func SmallScalar(pub *ecdsa.PublicKey) (k uint32, negated bool, ok bool)

SmallScalar reports the private scalar of pub when it is below Limit, or its negation n-k is. ok is false for any other key or an unsupported curve. The result is exact: the caller can confirm it with ScalarBaseMult.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL