Skip to content
ecdsa.com

Private key

The secret half of an asymmetric key pair, used to sign, decrypt or agree on keys; anyone who holds it can act as its owner, so it must never leave its trust boundary unprotected.
Also written asprivate keysecret keysigning key

Its form depends on the algorithm: a 32-byte scalar for P-256 and secp256k1, a 32-byte seed for Ed25519 and X25519, (n, e, d, p, q, dP, dQ, qInv) for RSA, and a 32-byte seed (or an expanded 2,560–4,896-byte key) for ML-DSA. Files wrap it as PKCS #8 (BEGIN PRIVATE KEY, or BEGIN ENCRYPTED PRIVATE KEY with a password), PKCS #1 (BEGIN RSA PRIVATE KEY), SEC 1 (BEGIN EC PRIVATE KEY), PKCS #12 bundles, the OpenSSH format or JWKs with a d member.

Protection options, from weakest to strongest: a plain file with tight permissions; a password-encrypted file (PBES2 with a slow KDF); an OS keystore (Keychain, DPAPI, Android Keystore); and non-exportable hardware (TPM, Secure Enclave, smart card, HSM, cloud KMS), where the key signs inside the device and cannot be copied out.

Never send private keys to web services, paste them into tickets or log them; tools on this site that inspect keys run locally and refuse private material where a public key is enough. If a private key leaks, revoke whatever binds it (certificate, JWKS entry, authorized_keys line) and rotate.

Standards and references

All terms