Independent learning for product cybersecurity professionals
SearchCommentary
Learning library / FoundationsCSL-106 · Foundations

Cryptography explained

Understand the systems, risks and protective measures behind cybersecurity.

Cryptography supports specific security goals. Choose a recognised mechanism for the job and manage its keys correctly.

What you will learn

  • Choose a cryptographic mechanism for a specific protection goal.
  • Distinguish encryption, hashing, authentication and digital signatures.
  • Explain why key handling and protocol use matter as much as algorithm choice.

The key ideas in brief

  • Explain the different purposes of cryptographic mechanisms.
  • Recognise why trust and key management matter.

The key ideas

MechanismPurpose
EncryptionProtect the confidentiality of data using a key.
Cryptographic hashProduce a digest useful for detecting changes when the expected digest is trusted.
Message authentication codeCheck integrity and origin using a shared secret.
Digital signatureCheck integrity and verify a signing identity using a private/public key pair.
CertificateBind a public key to an identity within a trust arrangement.

A plain hash does not establish who supplied a file. Encryption does not automatically establish authenticity. Use established libraries and protocols, and consider key generation, storage, rotation, revocation and recovery.

A practical example

A device verifies a firmware package’s digital signature against an authorised public key. This helps establish that the package is authorised and unchanged; it does not prove the software is free of defects.

Choose the mechanism by its purpose

Encryption transforms data so it can be recovered by holders of the appropriate key. A hash produces a digest useful for comparison, but anyone who can change a file can generally compute a new unkeyed digest. A message authentication code uses a shared secret to authenticate a message under that key. A digital signature can be verified using a public key while the signing key remains controlled by the signer.

These mechanisms make different claims. Publishing a checksum beside an update can help detect accidental corruption, but an attacker who replaces both can defeat that check. A signature can support authorised origin when the verifier trusts the right key. It does not establish that the update is compatible, safe or free from exploitable defects.

The system around the mathematics

Use established libraries and protocols rather than inventing a construction. Correct use includes appropriate randomness, nonce handling, certificate validation and error behaviour. Some encryption modes require a nonce never to repeat under a key; library guidance and a reviewed design should define how that requirement survives restart and concurrent operation.

Key provisioning, storage, permissions, rotation and revocation need owners. A private key copied into an ordinary source repository may compromise every package signed with it. A device that accepts any certificate bypasses a core part of connection authentication even if traffic is encrypted. Keep secrets out of logs, test reports and public build artefacts.

Plan failure and change

Describe what happens when a certificate expires, the expected trust anchor changes or a signing key is suspected compromised. Maintaining availability does not justify silently disabling authentication. Provide a controlled recovery route and evidence for the transition, including devices that have been offline.

For the temperature system, separate update-signing authority from the gateway’s upload credential. Compromising one gateway should not grant authority to sign firmware for all sensors. Record algorithm and key dependencies so future migration can be assessed. Verify rejected credentials and altered packages alongside successful operation; a positive demonstration alone leaves failure handling untested.

Apply the ideas

A sensor accepts an update when its hash matches a value included in the same package. Explain the missing protection. Propose an authenticity check and list two non-cryptographic release checks that are still required.

Compare your approach

An attacker can change the firmware and recompute the included hash. Authenticate the package using a signature from an authorised signing key and verify it against a protected trust anchor before installation. Still check product compatibility, allowed version transitions and verification of the release baseline. Define behaviour for an invalid signature and key rollover. The signature is one input to the update decision, not the entire decision.

Review your work

  • Does the mechanism support the claimed goal?
  • Where do the keys come from, and who can use them?
  • Are rejection, expiry and rotation paths defined and verified?

Keep this output: A cryptographic-purpose map with key owners and failure behaviour.

Continue learning