Public-key cryptography
Understand public and private keys
Use a shareable public key and protected private key while keeping encryption, agreement, and signing purposes distinct.
8 minute lesson
Public-key cryptography splits key material into a public part and a private part. The private key never becomes public.
Depending on the construction, the pair supports key agreement, encryption, or signatures. Do not assume one key pair should serve every purpose. Public keys still need an authenticated way to bind them to the expected identity.
An application downloads a public key from the same unauthenticated response as the signed update. An attacker replaces the update, signature, and public key together.
Public means shareable, not automatically trusted. Keep signing, encryption, and key-agreement keys separate so compromise or misuse of one purpose does not cross into another.
Classify the public and private material for an SSH login, TLS site, and package-signing workflow, and save how each public key gains trust. Verify one signed test message with the expected public key. Then substitute a new attacker-controlled key pair and show why mathematical verification alone is insufficient.
Lesson completed