Interactive cryptography

Crypto Signatures

Use ECDH as shared-secret context, then walk ECDSA, Ed25519 / EdDSA, Schnorr, and BLS through signature verification.

Read the article
Interactive crypto signatures

Start with ECDH context, then verify ECDSA, Ed25519 / EdDSA, Schnorr, and BLS.

Type a message, choose or generate the secret numbers, then click each button from left to right. The default message is hello world.

Privatesecret scalars, seeds, and signing keys
Publiccurve generators, public keys, and published points
Message / hashmessage bytes, digests, and challenges
Nonceone-time signing randomness and nonce points
Signaturesignature scalars or signature points
Derived secretshared/session values derived from secrets
Verificationpublic equality checks
Long-term key vs per-signature secret

Random keys are not the same thing as signing nonces.

The signature protocols below all start with long-term private material, but they differ on signing nonces. ECDSA needs a fresh random nonce k for each signature, while Ed25519 / EdDSA derives its nonce-like scalar deterministically from private material and the message.

Key creation randomnessUsed once to make the long-term private key.
Signing randomnessUsed fresh for each signature, depending on the scheme.
ECDSA

A random private key d is generated once, then every signature needs a fresh unpredictable nonce k. Reusingk can expose d.

Ed25519 / EdDSA

A random 32-byte seed is generated once. For each message, the nonce scalar is r = H(prefix || message), so the signer does not ask the RNG for a new nonce.

Schnorr

The demo exposes k so you can control the one-time nonce. Like ECDSA-style signing, reusing a nonce with the same private key is dangerous.

BLS

A random secret key sk is generated once. Basic BLS signs deterministically as sigma = sk * H(message), with no signing nonce.

ECDH context

Shared secret, no signature.

ECDH stays here as setup context because it uses the same scalar-to-point public-key move, but it is not part of the signature comparison below.

ECDH context

Shared secret, no signature.

Alice and Bob publish aG and bG. Each side reaches the same shared point (x_k, y_k). ECDH uses x_k, the x-coordinate, as the raw secret for key derivation.

Button formulas

ECDH context formulas

1public keys
A = aG; B = bG

Private scalars stay local. Public curve points can be sent over the network.

2shared point
S = (x_k, y_k) = aB = bA = abG

Both parties reach the same hidden point. ECDH normally uses x_k, the x-coordinate, as the raw shared secret.

3bind message
h = SHA-256(message); K = KDF(x_k) or demo SHA-256(x_k || message)

Standard ECDH feeds x_k into a KDF. This demo also folds in the message so message changes are visible.

4verify
aB == bA

ECDH verification here means both sides produced the same shared point, so they also have the same x_k.

OutputClick the ECDH buttons to generate shared-secret outputs.
1ECDSA: random nonce signature
2Ed25519 / EdDSA: deterministic signing
3Schnorr: linear public verification
4BLS: pairing equality
ECDSA

ECDSA signs with a long-term key and a fresh one-time nonce.

The signer computes R = kG, sets r = x(R) mod n, then computes s = k^-1(z + r*d) mod n. Reusingk with the same private key can expose d.

Button formulas

ECDSA button formulas

1public key
Q = dG; z = H(message)

d is the long-term private key. Q is the public verification key.

2fresh nonce
R = kG; r = x(R) mod n

ECDSA needs a fresh unpredictable k for every signature. Reusing k can expose d.

3sign
s = k^-1(z + rd) mod n

The signature is (r, s). It depends on the private key, message hash, and one-time nonce.

4verify
verify (r, s) using Q, z, and curve arithmetic

The verifier uses public data only, but the signer must protect both d and each k.

OutputClick the ECDSA buttons to generate outputs.
Ed25519 / EdDSA

EdDSA signs by deriving the nonce from the seed and message.

The nonce is deterministic: change the message and the signature changes. Verification checks S*B = R + k*A.

Button formulas

Ed25519 / EdDSA button formulas

1expand seed
SHA-512(seed) -> a, prefix

The seed expands into a clamped private scalar and a private prefix for nonce derivation.

2public key
A = aB

B is the fixed Ed25519 / EdDSA base point. A is the public verification key.

3sign
r = H(prefix || m); R = rB; k = H(R || A || m); S = r + ka

The signature is R || S and is tied to both the private scalar and the exact message.

4verify
S*B == R + k*A

The verifier recomputes k from public data and checks the public point equation.

OutputClick the Ed25519 / EdDSA buttons to generate outputs.
Schnorr

Schnorr keeps the verification equation linear.

This uses secp256k1 point arithmetic with a teaching challenge hash. The verifier checks sG = R + eP. The nonce kis a one-time signing secret and must not be reused with the same key.

Button formulas

Schnorr button formulas

1public key
P = dG; z = SHA-256(message)

d is the private signing key. P and the message digest z are public verification inputs.

2nonce point
R = kG

The nonce scalar k must stay secret. Reusing it can reveal the private key.

3sign
e = H(R || P || z); s = k + ed

The signature is R plus s. The challenge binds the nonce point, public key, and message hash.

4verify
sG == R + eP

Schnorr verification is a direct public linear equation.

OutputClick the Schnorr buttons to generate outputs.
BLS

BLS verification moves the check into a pairing target group.

This is a small pairing model: e(aP,bQ) = 64^(a*b mod 101) mod 607. It shows the real BLS verification shape without shipping a BLS12-381 library.

Button formulas

BLS button formulas

1keys + hash
PK = skQ; H(m) in G1

The real scheme hashes the message to a curve point. This demo uses a tiny scalar model.

2sign
sigma = sk * H(m)

The signature is the message point scaled by the private key.

3pair
e(sigma, Q) and e(H(m), PK)

The verifier maps both sides into the pairing target group.

4verify
e(sigma, Q) == e(H(m), PK)

Both pairings hide the same product: sk times the message hash point.

OutputClick the BLS buttons to generate outputs.
Side-by-side signature pipeline

Same stages, four different signature shapes.

Read each row left to right. The row name stays the same across protocols; the marker shows where the protocol keeps the shared shape, changes it, or does not have that stage.

ECDSArandom nonce signature
Ed25519 / EdDSAdeterministic EdDSA
Schnorrlinear signature equation
BLSpairing signature
01

Random Number Generator

Start by creating secret material no one else can guess.

ECDSAsame row
d, k = RNG()

ECDSA generates a long-term private key, then needs fresh signing randomness for k.

Ed25519 / EdDSAsame row
seed = RNG(32 bytes)

The random seed is the private root of the Ed25519 / EdDSA key.

Schnorrsame row
d, k = RNG()

The signing key and nonce both require strong randomness.

BLSsame row
sk = RNG()

A single secret scalar controls the BLS public key and signatures.

Current row values

Use the message and keys above to populate this row for every protocol column.

ECDSA

Click the row button to show values.

Ed25519 / EdDSA

Click the row button to show values.

Schnorr

Click the row button to show values.

BLS

Click the row button to show values.

02

Private Key

Give the random material a private-key role.

ECDSAsame row
d in [1, n - 1]

d is the long-term signing key. It must not be revealed.

Ed25519 / EdDSAx differs
SHA-512(seed) gives a and prefix

The seed expands, then the scalar is clamped before use.

Schnorrsame row
d in [1, n - 1]

A normal secp256k1 private scalar signs messages.

BLSsame row
sk in [1, r - 1]

The private key is a scalar modulo the group order.

Current row values

Use the message and keys above to populate this row for every protocol column.

ECDSA

Click the row button to show values.

Ed25519 / EdDSA

Click the row button to show values.

Schnorr

Click the row button to show values.

BLS

Click the row button to show values.

03

Public Key

Move from private scalar world into public group elements.

ECDSAsame row
Q = dG

ECDSA publishes Q and keeps d private.

Ed25519 / EdDSAsame row
A = aB

The base point is Ed25519 / EdDSA B rather than secp256k1 G.

Schnorrsame row
P = dG

The public key is the private scalar times the generator.

BLSx differs
PK = skQ

The public key usually lives in the second pairing group.

Current row values

Use the message and keys above to populate this row for every protocol column.

ECDSA

Click the row button to show values.

Ed25519 / EdDSA

Click the row button to show values.

Schnorr

Click the row button to show values.

BLS

Click the row button to show values.

04

Hash Function

Turn the message into fixed-size material the protocol can bind.

ECDSAsame row
z = SHA-256(m)

ECDSA signs a message digest z, reduced into the scalar field.

Ed25519 / EdDSAx differs
H = SHA-512; input is prefix, R, A, m

Ed25519 / EdDSA hashes during nonce and challenge derivation.

Schnorrsame row
z = SHA-256(m)

The digest z is later mixed into the challenge.

BLSx differs
H(m) = hash-to-curve(m)

BLS maps the message to a curve point, not just a byte digest.

Current row values

Use the message and keys above to populate this row for every protocol column.

ECDSA

Click the row button to show values.

Ed25519 / EdDSA

Click the row button to show values.

Schnorr

Click the row button to show values.

BLS

Click the row button to show values.

05

Nonce / Commitment

Some signature schemes publish a one-time commitment before forming the signature.

ECDSAsame row
R = kG; r = x(R) mod n

k must be fresh and unpredictable for each signature.

Ed25519 / EdDSAx differs
r = H(prefix || m); R = rB

The nonce is deterministic for the same seed and message.

Schnorrsame row
R = kG

The nonce must never repeat for the same private key.

BLSx absent
No nonce point

Basic BLS signing is deterministic once sk and H(m) are fixed.

Current row values

Use the message and keys above to populate this row for every protocol column.

ECDSA

Click the row button to show values.

Ed25519 / EdDSA

Click the row button to show values.

Schnorr

Click the row button to show values.

BLS

Click the row button to show values.

06

Protocol Bind

Each protocol ties together public data, private data, and the message differently.

ECDSAx differs
r binds R; s binds z, r, and d

ECDSA binds the nonce point x-coordinate, message digest, and private key through s.

Ed25519 / EdDSAsame row
k = H(R || A || m)

The challenge binds nonce point, public key, and message.

Schnorrsame row
e = H(R || P || z)

Same challenge shape, with Schnorr naming and secp256k1 points.

BLSx differs
Pairing compares sigma with H(m)

The message binding is checked through the pairing equation.

Current row values

Use the message and keys above to populate this row for every protocol column.

ECDSA

Click the row button to show values.

Ed25519 / EdDSA

Click the row button to show values.

Schnorr

Click the row button to show values.

BLS

Click the row button to show values.

07

Digital Signature

Produce the authorizing signature object.

ECDSAsame row
s = k^-1(z + rd) mod n; sig = (r, s)

ECDSA outputs two scalars, r and s.

Ed25519 / EdDSAsame row
S = r + ka; sig = R || S

The output is the nonce point plus the signature scalar.

Schnorrsame row
s = k + ed; sig = R || s

The linear scalar equation is the heart of Schnorr.

BLSx differs
sigma = sk * H(m)

The signature is one curve point instead of R plus a scalar.

Current row values

Use the message and keys above to populate this row for every protocol column.

ECDSA

Click the row button to show values.

Ed25519 / EdDSA

Click the row button to show values.

Schnorr

Click the row button to show values.

BLS

Click the row button to show values.

08

Verification

Anyone can check the public equation without learning the private key.

ECDSAx differs
x((z*s^-1)G + (r*s^-1)Q) mod n == r

The verifier rebuilds a point from public data and checks its x-coordinate.

Ed25519 / EdDSAsame row
S*B == R + k*A

The verifier recomputes k from public data and the message.

Schnorrsame row
sG == R + eP

A clean public linear equation checks the signature.

BLSx differs
e(sigma, Q) == e(H(m), PK)

The verifier checks equality in the pairing target group.

Current row values

Use the message and keys above to populate this row for every protocol column.

ECDSA

Click the row button to show values.

Ed25519 / EdDSA

Click the row button to show values.

Schnorr

Click the row button to show values.

BLS

Click the row button to show values.

09

Main Difference

The row where the protocol stops looking like the others.

ECDSAx differs
Fresh random nonce required for each signature

ECDSA is fragile if k repeats or is predictable; d can often be recovered.

Ed25519 / EdDSAx differs
Deterministic nonce from the private prefix

The nonce is derived from seed material and the message.

Schnorrx differs
Minimal linear signature relation

Schnorr exposes the simplest R, challenge, scalar flow.

BLSx differs
Pairing check and one-point signature

BLS is shaped around bilinear pairings and compact signatures.

Current row values

Use the message and keys above to populate this row for every protocol column.

ECDSA

Click the row button to show values.

Ed25519 / EdDSA

Click the row button to show values.

Schnorr

Click the row button to show values.

BLS

Click the row button to show values.