Pcornel
Security · Asymmetric Cryptography

Key Pair

Cheat sheet · https://pcornel.dk/topic.php?topic=4703

Back to the Topic

Answer

A key pair is a mathematically linked public and private key generated together, for example with openssl genpkey or ssh-keygen. What one key does, only the other can undo or verify.

Remember

  • Generate keys on the system that will use them.
  • Protect the private key.
  • Back up keys that protect data.

First checks

  • ssh-keygen -t ed25519 -C <comment> — generate SSH key pair
  • openssl genpkey -algorithm ED25519 -out key.pem — generate
  • Key generation location — on target system/HSM

Verify in this order

CSPRNG → private key → derived public key

Where it usually breaks

First mismatch in key/secret generation → storage/rotation → trust/certificate validation → protocol negotiation → cryptographic operation → peer/application verification; preserve identity/policy/pre-state before mutation.

Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=4703

Confirmation

Confirm action

Continue?