EC Cryptography Toolbox

This tool calculates the public key from a private key using elliptic curve cryptography with the NIST P-256 curve.

Info: Enter your private key as a hexadecimal string (64 characters for P-256). The tool will calculate the corresponding public key coordinates.
Example: c6047f9441ed7d6d3045406e95c07cd85c778e4b8cef3ca7abac09b95c709ee5
Example: f8f8a2f43c8376ccb0871305060d7b27b0554d2cc72bccf41b2705608452f315

Public Keys (Uncompressed Format)

Party A Public Key

Party B Public Key

🔐 ECDH Shared Secret

In ECDH, only the X coordinate of the shared point is typically used as the shared secret.

ECDH Key Exchange

The Elliptic Curve Diffie-Hellman (ECDH) key exchange allows two parties to establish a shared secret over an insecure channel:

  1. Party A generates private key a and calculates public key A = a × G
  2. Party B generates private key b and calculates public key B = b × G
  3. Both parties exchange their public keys
  4. Party A calculates shared secret: S = a × B
  5. Party B calculates shared secret: S = b × A
  6. Both parties arrive at the same shared secret S = a × b × G

Security Properties

  • The shared secret cannot be derived by an eavesdropper who only knows the public keys
  • Based on the computational difficulty of the Elliptic Curve Discrete Logarithm Problem (ECDLP)
  • The X coordinate of the shared point is typically used as the shared secret for further cryptographic operations

How It Works

The tool implements elliptic curve point multiplication using the NIST P-256 curve parameters:

  • Prime field: p = 2^256 - 2^224 + 2^192 + 2^96 - 1
  • Curve equation: y² = x³ - 3x + b (mod p)
  • Base point: Pre-defined generator point G
  • Public key calculation: Q = k × G where k is the private key

Key Features

  • Input validation: Ensures private key is valid hex and within curve order
  • Secure arithmetic: Uses BigInt for precise modular arithmetic
  • Efficient algorithm: Double-and-add method for scalar multiplication
  • Clear output: Separate display of X and Y coordinates

Security Notes

  • Private keys must be randomly generated and kept secure
  • This tool is for educational/development purposes
  • Never enter real private keys in web tools for production use

This tool implements the mathematical foundations of elliptic curve cryptography as specified in NIST standards.