CEH · M20

Hashing, encryption and signatures: choose the protection goal

The same data may need secrecy, change detection and origin verification. These goals require distinct mechanisms, together with key management and trusted references.

After this lesson, you can
  • Choose mechanisms for secrecy, digest comparison and origin verification.
  • Identify the roles of key custody and trust in a public key.

Prerequisites: CIA and security controls: define what needs protection

Three mechanisms address different questions

Hashing maps bytes to a fixed-length digest for content comparison; it is not encryption that a key reverses. Encryption allows an appropriate key holder to recover data and addresses secrecy. Modern systems also need ciphertext integrity, typically through mature authenticated-encryption interfaces.

A digital signature is produced with a private key and verified with the corresponding public key. It supports integrity and signer-origin verification without hiding document contents. Verification also depends on trusting the relationship between the public key and the claimed identity.

Further reading: Python: hashlib·NIST FIPS 186-5: Digital Signature Standard

Algorithms need key custody and process

If a private key leaks, an attacker may produce apparently valid signatures. If a recipient accepts an attacker-supplied public key, verification may authenticate the wrong identity. Address key storage, rotation, revocation and trusted distribution.

This unit practices mechanism selection and revisits the hash example. Do not design custom cryptographic algorithms or treat teaching strings as real keys. Protection must be assessed within the complete protocol and deployment context.

Example: public downloads and private research files

A public course download should let readers verify consistency with the publisher. A private research file additionally needs restricted reading.

A trusted digest supports content comparison. A signature under a trusted public key adds signer verification. Private files additionally need appropriate encryption and access controls. A valid signature does not make a file confidential.

Conclusion: Combine mechanisms by requirement and verify content, origin and confidentiality separately.

Tabletop exercise: match goals to mechanisms

Use fictional requirements without creating or exposing real keys.

  1. List download digest comparison, private-file secrecy and publisher-signature verification.
  2. Match them to hashing, encryption and digital signatures.
  3. Add one trust or key assumption to each match.

Expected result

Digest comparison needs a trusted reference; encryption needs protected keys; signatures need trusted public keys and private-key custody.

Check your work

With a valid signature but an unknown public-key origin, which identity claim remains unestablished?

Finish and clean up

Save the mapping. No keys or secrets were created.

Q&A · Check your reasoning

Choose an answer and confidence, then read every explanation. Answers stay in this browser.

ceh-m20-crypto-q1 · Original practice

Does successful signature verification establish confidentiality?

Does successful signature verification establish confidentiality?
ceh-m20-crypto-q2 · Original practice

How should a public download’s hash be assessed?

How should a public download’s hash be assessed?

Connect the next idea

Terms: Hash·Digital signature·Encryption

Sources & scope

These sources support the technical principles. Examples, questions and exercises are original to this series.