liveBook · Manning

Private key

As explained in Elliptic Curve Cryptography for Developers

The secret key in an asymmetric cryptographic key pair that is controlled by its owner and used for signing or decryption operations.

A private key is secret data controlled by its owner in an asymmetric key pair. It derives a public key, creates shared secrets, and signs documents; security depends on keeping it secret. section 1.3 section 4.1.3

Use the private key in three closely related flows:

  • Create a public key by multiplying the private scalar by a public base point: A = k_A G. section 4.1.1
  • Derive a shared secret by multiplying the other party’s public key by the local private key; both sides obtain k_A k_B G. section 1.3.1 section 4.1.1
  • Sign a document together with its hash so anyone can verify authorship and detect even a one-bit modification using the public key. section 1.3.2

For elliptic-curve systems, choose a secure curve and public base point G. Convert a pass phrase into an integer, commonly by hashing modulo the curve order, or use another bit string. The resulting scalar is the private key; elliptic-curve multiplication produces the public key. section 4.1.1 section 4.1.3

Alice and Bob

Alice keeps k_A secret and publishes A = k_A G. Bob does the same with k_B and B. Alice computes k_A B, while Bob computes k_B A; both equal the shared point S and can derive symmetric-key material from its x component. Only public keys and the encrypted message cross the open network. section 1.3.1 section 4.1.1

Listing 4.3 Key generation
void gen_key(mpz_t sk, POINT *PK, unsigned char *phrase, BASE_SYSTEM bse)
{
  long np;

  np = 0;   #1
  while(phrase[np]) np++;   #1
  hash(sk, phrase, np, bse.order);  #2
  elptic_mul(PK, bse.Base, sk, bse.E);
}

Shows the compact implementation flow: measure the pass phrase, hash it into the private scalar, and multiply the base point to obtain the public key. section 4.1.3

Listing 18.2 Key generation for pairing signatures
void keygen(mpz_t sk, POLY_POINT *PK, POLY_POINT G2, POLY_CURVE Ex,
            unsigned char *ptr, int len)
{
   #1
  mpz_import(sk, len, -1, 1, 0, 0, ptr);  #1
  poly_elptic_mul(PK, G2, sk, Ex);  #2
}  #2

Extends the same pattern to pairing-based signatures by importing input bytes as a scalar and multiplying a field-extension base point. section 18.3.1

How Elliptic Curve Cryptography for Developers covers it

How deep it goes
Explains key roles, elliptic-curve equations, scalar generation, and C-style routines, while deferring full implementation security details.
Examples
Uses Alice–Bob exchange, document signatures, finite-field equations, pass-phrase hashing, and pairing-signature key-generation listings.
What it assumes
Assumes basic encryption terminology, then develops public-key roles, finite-field curve parameters, scalar multiplication, and hash-based key generation.
What you can do after
Build it from scratch by converting secret input into a scalar and deriving public or shared elliptic-curve values.
How it connects
Connects private keys to public keys, elliptic-curve multiplication, key exchange, digital signatures, hash functions, AES, and the elliptic-curve discrete logarithm problem.

Also explained in

Compare how 13 books explain private key →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Elliptic Curve Cryptography for Developers. The section links point to the parts of the book it draws on.