Concepts / Cryptography at work

Cryptography at work

Leaked private key

Also called private key exposure, key in a backup, key revocation, key rotation

A private key is a credential in a file: copied out of a backup, a world-readable home or a git repo, it authenticates as the owner on every server that trusts its public half — and because the theft is a silent copy, nothing warns you it happened — so the only fix is to revoke it on the server and rotate to a fresh pair.

A copied key logs in as its owner
A copied key logs in as its owner

The key file is the whole credential, and reading a copy raises no alert. The fix is on the server: remove its public key from authorized_keys, then issue a new pair.

A leaked private key is a copy of a [[key-based-auth|key authentication]] private key in the wrong hands. The file is the whole credential: whoever reads it logs in as its owner, and copying it triggers no alert. Keys leak through backups, world-readable directories and git history. You cannot un-leak one: revoke it by removing its public key from every authorized_keys, then rotate to a new pair. Scan repos with gitleaks.

See it on real machines

Read next

Learn it on real machines.

Every lab is a small network of real Linux machines in your browser. Sign in with Google or email to start.

Start this lab