From 55d1ce73a164e84cb8234b1ad66f0ef4d9429f1b Mon Sep 17 00:00:00 2001 From: Heiko Schaefer Date: Wed, 4 Oct 2023 10:46:25 +0200 Subject: [PATCH] ch3: improvements suggested by @vanitasvitae fixes #34 --- book/source/03-cryptography.md | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/book/source/03-cryptography.md b/book/source/03-cryptography.md index a6ec9fd..71dcf29 100644 --- a/book/source/03-cryptography.md +++ b/book/source/03-cryptography.md @@ -12,6 +12,11 @@ [(Cryptographic) hash functions](https://en.wikipedia.org/wiki/Cryptographic_hash_function) map binary data of arbitrary length to a fixed size "hash" (hashes are also sometimes called "digests"). +Hash functions are used in cryptography to produce shorthand "placeholders" for data. Two properties of cryptographic hash functions are particularly important: + +- ["Pre-image resistance"](https://en.wikipedia.org/wiki/Preimage_attack): Given a hash value, it should be hard to find a message that maps to that hash value. +- ["Collision resistance"](https://en.wikipedia.org/wiki/Collision_resistance): It should be hard to find two messages that map to the same hash value. + ## Symmetric-key cryptography [Symmetric-key cryptography](https://en.wikipedia.org/wiki/Symmetric-key_algorithm) uses the same cryptographic key for both encryption and decryption. Symmetric-key cryptographic systems support *encryption/decryption* operations. @@ -36,7 +41,9 @@ However, exchanging the required shared secret is a problem that needs to be sol Symmetric cryptography is used in OpenPGP as part of a hybrid cryptosystem. -Where symmetric keys are used in OpenPGP, they are referred to as "session keys." +Where symmetric keys are used in OpenPGP, they are called either "message keys" or "session keys[^sessionkey]." + +[^sessionkey]: In OpenPGP version 6, when using the ["Version 2 Symmetrically Encrypted Integrity Protected Data Packet Format"](https://www.ietf.org/archive/id/draft-ietf-openpgp-crypto-refresh-10.html#name-version-2-symmetrically-enc), a "message key" is derived from a "session key". Previously (up to OpenPGP version 4, and in version 6 when using ["Version 1 Symmetrically Encrypted Integrity Protected Data Packet Format"](https://www.ietf.org/archive/id/draft-ietf-openpgp-crypto-refresh-10.html#name-version-1-symmetrically-enc)), the "session key" was used directly as a symmetric encryption key. ### Authenticated encryption with associated data (AEAD) @@ -48,7 +55,7 @@ In OpenPGP version 6, AEAD is used to solve the problem of "malleability": In pa [Public-key cryptography](https://en.wikipedia.org/wiki/Public-key_cryptography) systems use asymmetric pairs of related keys. Public-key cryptographic systems support *encryption/decryption* and *digital signature* operations. -Public-key cryptography doesn't require participants to pre-arrange a shared secret. +Unlike symmetric cryptography, public-key cryptography doesn't require participants to pre-arrange a shared secret. (asymmetric_key_pair)= ### Asymmetric cryptographic key pairs