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.
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:
- Party A generates private key
a
and calculates public keyA = a × G
- Party B generates private key
b
and calculates public keyB = b × G
- Both parties exchange their public keys
- Party A calculates shared secret:
S = a × B
- Party B calculates shared secret:
S = b × A
- 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.