Diffie-Hellman comparison

One hidden product, three algebraic worlds.

These systems preserve the hidden scalar relationship a * b. The operations and public inputs are visible, but a, b, and the raw product a * b remain private. What changes is the encoded result: g^(ab), abP, or e(P,Q)^(ab), and who is meant to compute it. RSA is shown as a nearby contrast: it hides a factorization trapdoor, not the same hidden product.

Publicoperator, g/P/Q, public keys
Privatea, b, raw a * b
Encoded resultDH/ECDH: private to Alice and Bob; pairing: often public
RSA contrastpublic n,e; private p,q,d
Read blog
Ordinary DH

Numbers in a finite group

shared = g^(ab)

Alice applies her secret exponent to Bob's public value. Bob does the symmetric calculation.

ECDH / X25519

Points on an elliptic curve

shared = abP

The same hidden product appears as scalar multiplication of a public base point.

Pairings

Public map into GT

shared-like value = e(P,Q)^(ab)

The result moves into a target group, and public keys can often be combined publicly.

RSA contrast

Trapdoor from factorization

n = p*q; e*d = 1 mod lambda(n)

RSA belongs nearby, but it hides the factors and private exponent, not a two-party hidden product.

Bitcoin address

Hash a secp256k1 public key

Base58Check(0x00 || HASH160(pubkey))

Legacy P2PKH addresses use SHA-256, RIPEMD-160, a version byte, and a checksum.

Ethereum address

Take the last 20 bytes

last20(Keccak256(pubkey_x || pubkey_y))

Ethereum hashes the uncompressed secp256k1 public key without the leading 0x04 byte.

Comparison matrix

Same hidden product, with RSA shown as a trapdoor contrast.

RSA is useful to compare because it is also asymmetric crypto, but the secret is different: knowingp and q lets you compute the private exponent d. It is not trying to preserve or expose an encoded a * b relationship.

SystemProtocol shapePublic starting objectPrivate input(s)Public output(s)CalculationResultMain algebra or hash ruleWhere result livesTypical use
Ordinary Diffie-HellmanTwo-party key agreementGenerator number gAlice secret a and Bob secret bAlice publishes g^a; Bob publishes g^bAlice computes (g^b)^a; Bob computes (g^a)^bg^(ab)(g^a)^b = g^(ab)Number/group elementOlder finite-field DH
Elliptic-Curve Diffie-Hellman / X25519Two-party key agreementPublic curve point PAlice secret a and Bob secret bAlice publishes aP; Bob publishes bPAlice computes a(bP); Bob computes b(aP)abPa(bP) = abPElliptic-curve pointModern secure connections
Pairing versionPublic pairing relation or scheme-specific key/proof checkTwo public curve points, often P in G1 and Q in G2Scheme scalars such as a and bCould publish aP and bQ, depending on schemeOften compute e(aP, bQ)e(P,Q)^(ab)e(aP,bQ) = e(P,Q)^(ab)Target group element, usually written GTIdentity-based crypto, BLS signatures, zk-SNARKs
RSA contrastTrapdoor public-key encryption or signature systemModulus n and public exponent ePrime factors p and q, plus private exponent dPublic key (n,e), ciphertexts, and signaturesEncrypt or verify with x^e mod n; decrypt or sign with x^d mod nMessage/ciphertext/signature relation, not a hidden a*b productn = p*q and e*d = 1 mod lambda(n)Integer modulo nTLS history, certificates, encryption, and signatures
Bitcoin key/addressSingle-account key pair and address derivationsecp256k1 generator point GOne account private scalar kPublic key K = kG, usually compressed for P2PKHHASH160(compressed public key), then Base58CheckBitcoin address, for example P2PKHaddress = Base58Check(0x00 || RIPEMD160(SHA256(K)))Base58Check address stringReceiving funds and identifying spend conditions
Ethereum key/addressSingle-account key pair and address derivationsecp256k1 generator point GOne account private scalar kUncompressed public key K = kG = 0x04 || x || yKeccak256(x || y), then take the last 20 bytesEthereum account addressaddress = last20(Keccak256(public_key_without_04))20-byte address, usually hex with optional EIP-55 checksum casingAccount identity for balances, transactions, and contracts
Intentional capability

Pairings do not reveal the ECDH shared point.

In ordinary ECDH, an outsider seeing P, aP, and bP should not derive abP. In a pairing-friendly setting, a public observer may compute e(aP,bQ). That reveals a related target-group value, not a, b, or abP.

TechnologyWhat it intentionally lets you do
X25519Only Alice and Bob derive abP
PairingsPublicly combine points into e(P,Q)^(ab)
BLS signaturesVerify a signature relation with pairings
zk-SNARKsVerify algebraic proof relations efficiently
Identity-based encryptionDerive public keys from identities such as an email address
The crucial difference

Inputs and outputs, split by public and private.

The confusing part is that aP and bP look similar to aP and bQ, but the output visibility is different.

InputOutput

DH finite-field form

Public

g, g^a, g^b

Private

a, b

DH finite-field form

Public

No public shared-secret output

Private

g^(ab), computed independently by Alice and Bob

ECDH point form

Public

P, aP, bP

Private

a, b

ECDH point form

Public

No public shared-point output

Private

abP, computed by Alice and Bob

Pairing form

Public

P, Q, aP, bQ

Private

a, b, used to create the public points

Pairing form

Public

e(aP,bQ) = e(P,Q)^(ab)

Private

a, b, raw a * b, and abP stay hidden

RSA

Public

n, e, message/ciphertext/signature

Private

p, q, and private exponent d

RSA

Public

ciphertext, signature, or verify true/false

Private

decrypted plaintext if using d to decrypt

ECDSA / Schnorr

Public

public key P, message hash z, signature (r,s) or (R,s)

Private

private signing key d and one-time nonce k during signing

ECDSA / Schnorr

Public

signature plus verify true/false

Private

none; d and k must not appear as outputs

Bitcoin address

Public

public key K, HASH160, address, or scriptPubKey

Private

private scalar k needed to create spending signatures

Bitcoin address

Public

address, locking script, or signed transaction

Private

none; the wallet keeps k private

Bitcoin Script

Public

scriptPubKey plus scriptSig / witness

Private

private keys for signatures, and secret preimages when required

Bitcoin Script

Public

pass/fail validation and a ledger state change

Private

none unless the script intentionally reveals a preimage

Ethereum address

Public

address, transaction fields, and signature

Private

private scalar k for the externally owned account

Ethereum address

Public

recovered signer address and accepted/rejected transaction

Private

none; k remains private in the wallet

Applications and use cases

Where these primitives show up in real systems.

The same page compares several different jobs: agreeing on a shared secret, proving algebraic relations, signing, addressing wallets, and locking coins.

Transport security

DH and ECDH create short-lived shared secrets before symmetric encryption starts.

  • TLS DHE and ECDHE handshakes
  • SSH key exchange
  • IPsec/IKE group negotiation

Blockchain identity and verification

Curve public keys become addresses, while pairings let many signatures or proof checks compress into one relation.

  • Bitcoin and Ethereum wallet addresses
  • Ethereum consensus BLS signatures
  • KZG commitments for polynomial openings

Trapdoor signatures and encryption

RSA is nearby public-key cryptography, but its hidden object is p, q, and d rather than a shared product.

  • Certificate signatures
  • PGP/GPG keys
  • S/MIME email encryption