CISSP Domain 3: Cryptographic Algorithms & Primitives — Mindmap Review Study Guide
# Cryptographic Services - CISSP Study Material
═══════════════════════════════════
## PART 1: MERMAID MINDMAP
═══════════════════════════════════
```mermaid
mindmap
root((Cryptographic Services))
5 Major Services
Confidentiality
Integrity
Hashing
Authenticity
Non-Repudiation
Origin
Delivery
Access Control
Cryptographic Terminology
Plaintext/Clear text
Encrypt
Key/Crypto variable
Decrypt
Key clustering
Work factor
Initialization vector/Nonce
Confusion
Diffusion
Avalanche effect
Secret Writing
Hidden methods
Steganography
Null Cipher
Scrambled Cryptography
One-way encryption
Hashing
MD5
SHA-1
SHA-2
SHA-3
Two-way encryption
Symmetric algorithms
Key distribution problem
Scalability problem
Block ciphers
DES
3DES
AES/Rijndael
CAST-128
SAFER
Blowfish
Twofish
RC5/RC6
Block modes
ECB
CBC
CFB
OFB
CTR
Stream ciphers
RC4
Asymmetric algorithms
Private key
Public key
Hard math problems
Factoring
RSA
Discrete logs
Diffie-Hellman
ECC
El Gamal
DSA
Knapsack
Digital Certificates
Digital Signatures
Substitution
Caesar Cipher
Monoalphabetic
Polyalphabetic
Running key cipher
One-time pads
Transposition
Spartan Scytale
Rail Fence/Zigzag
═══════════════════════════════════
PART 2: TECHNICAL DEFINITIONS & CONCEPTS
═══════════════════════════════════
5 Major Services
Confidentiality — Allows data to be made available only to those authorized to view it. Prevents unauthorized disclosure of information.
Integrity — Ensures information has not been manipulated or changed by unauthorized individuals. Prevents unauthorized or unexpected changes to data.
- ⚠️ EXAM TIP: Equate hashing with integrity in your mind — hashing = integrity | integrity = hashing
Hashing — Used to achieve integrity. One-way mathematical function that transforms arbitrary length input to fixed length output (message digest).
Authenticity — Means we can confirm who something came from. For instance, verify that a message came from a particular sender.
Non-Repudiation — Prevents someone from denying prior actions. Has two flavors: origin and delivery.
Non-Repudiation of Origin — Means the sender cannot deny that they sent a specific message. They cannot deny the exact message originated from them.
Non-Repudiation of Delivery — Means the receiver cannot deny that they received a specific message.
Access Control — Cryptography enables access control by controlling who we give ciphertext to and who we give the decryption key to, thereby controlling who can decrypt and access data.
Cryptographic Terminology
Plaintext/Clear text — Simply data that is readable by anyone.
Encrypt — The process of turning plaintext into ciphertext using a cryptographic algorithm and a crypto variable (key). Done to protect plaintext and provide confidentiality.
Key/Crypto variable — A string of bits that must be kept secret. This string of bits essentially programs the cryptographic algorithm. The key determines the specific steps that the cryptographic algorithm will perform to encrypt or decrypt — to transform plaintext into ciphertext (encryption) or ciphertext back into plaintext (decryption).
Decrypt — Turning ciphertext back into plaintext using a cryptographic algorithm and a key.
Key clustering — Where two different keys generate the same ciphertext from the same plaintext. This is something that we definitely want to avoid and good cryptographic algorithms are designed to minimize or ideally eliminate key clustering. Key clustering is bad because if two keys will decrypt some ciphertext, that suddenly makes it twice as easy to try to perform a brute force attack.
Work factor — An estimated amount of time or effort required by an attacker to break a cryptosystem. The higher the work factor, the more secure the cryptosystem.
Initialization vector/Nonce — A random number that is used along with the key and fed into a cryptographic algorithm when encrypting some plaintext. IVs should only be used once in any session and are meant to help prevent patterns in the ciphertext that is generated. You can feed the same plaintext into a cryptographic algorithm and use the same key, and so long as you use a different IV, then it avoids producing the same ciphertext and thus avoids patterns.
Confusion — A property focused on hiding the relationship between the key and the resultant ciphertext. If one bit of the key is changed, then about half of the bits in the ciphertext should change.
Diffusion — Same idea as confusion but focused on the plaintext. If a single bit of the plaintext is changed, then about half of the bits in the ciphertext should change. The diffusion property is all about hiding the relationship between plaintext and the ciphertext.
Avalanche effect — Used to determine the security of an algorithm. Looks at the degree of confusion and diffusion that an algorithm provides. The ideal case is that a single bit change to either the key (confusion) or the plaintext (diffusion) will result in at least a 50% change in the ciphertext.
Secret Writing
Steganography — The technique of hiding secret data within an ordinary, non-secret file to avoid detection. For example, plaintext is hidden within a picture file, like a JPEG image.
Null Cipher — A secret message is hidden in plain sight by mixing the characters of the secret message with non-ciphertext (plaintext). For example, the secret message could be the first letter of each word in a paragraph.
Scrambled Cryptography
One-way encryption
One-way encryption — Means that we turn plaintext into ciphertext, but then we cannot go back in the other direction. We can’t determine what the plaintext was from the ciphertext. We use one-way encryption for integrity.
Hashing — Uses one-way mathematical functions which transform an arbitrary length input to a fixed length output — a fixed length message digest. Hashing algorithms need to be deterministic which means the same input will always result in the same output, the same digest — this is how we use hashing for integrity. If you hash the same file over and over again you will always get the same message digest. But if even a single bit in a massive file is changed, then the message digest will be completely different. By hashing a file at different times and comparing the hash values, you can easily see if a file has changed — integrity.
MD5 — Hashing algorithm you should be able to recognize.
SHA-1 — Hashing algorithm you should be able to recognize.
SHA-2 — Hashing algorithm you should be able to recognize.
SHA-3 — Hashing algorithm you should be able to recognize.
Two-way encryption
Two-way encryption — Means we can encrypt some plaintext with a key turning it into ciphertext and then as long as we have the right key we can decrypt the ciphertext and turn it back into plaintext. We can encrypt and then later decrypt — we can go in both directions.
Symmetric algorithms — Use just one key to encrypt and the same key to decrypt. Can be orders of magnitude faster than asymmetric algorithms. Whenever you need to encrypt lots of data, and encrypt quickly and efficiently you need to use symmetric algorithms.
Key distribution problem — Symmetric cryptography uses the same key to encrypt and the same key to decrypt, which means that if you want to send some data securely you need to encrypt it and send that ciphertext to someone and the key they need to decrypt it. Anyone could intercept the message and get the ciphertext and the key necessary to decrypt it. To solve this, you could send the key out-of-band (often not convenient or efficient) or use hybrid cryptography.
Scalability problem — If you want to talk to one other person securely you need just one key. Two other people, you need 3 keys. 3 other people: 6 keys. 4 other people: 10 keys. The formula is N×(N-1)/2 and the problem is the number of keys you need grows exponentially. At only 1000 other people you need over half a million keys.
Block ciphers
Block ciphers — Encrypt or decrypt blocks of data at once. 16 bits of data, 32, 64 or 128 bit blocks.
DES (Data Encryption Standard) — Uses 56-bit keys, and 64-bit blocks, and does 16 rounds of substitution and transposition. A 56-bit key is nowhere near good enough anymore as 56-bit keys can be easily brute forced. So, DES should not be used.
Triple DES (3DES) — Uses the DES algorithms 3 times and essentially uses 3 56-bit keys (although there are various ways triple DES can be configured which is beyond the scope of the exam). This gives triple DES a key length of 168 bits (3 × 56). However, due to an attack known as the meet-in-the-middle attack, the effective key length of DES is only 112-bits.
AES/Rijndael (Advanced Encryption Standard) — When the US government saw that DES was becoming obsolete, they ran a competition to find a replacement and the winner was an algorithm called Rijndael. Rijndael was subsequently renamed to AES. AES is an excellent and pervasively used encryption algorithm. It has a variable key length which can be: 128 bits, 192 or 256 bits. And it uses 128-bit blocks.
CAST-128 — Symmetric block cipher algorithm you should be able to recognize.
SAFER — Symmetric block cipher algorithm you should be able to recognize.
Blowfish — Symmetric block cipher algorithm you should be able to recognize.
Twofish — Symmetric block cipher algorithm you should be able to recognize.
RC5/RC6 — Symmetric block cipher algorithms you should be able to recognize.
Block modes
Block modes — Different ways of encrypting blocks of plaintext or decrypting blocks of ciphertext. The various block modes have advantages and disadvantages.
ECB (Electronic Codebook) — The LEAST secure of the block modes because it does not use an initialization vector. It is also the fastest because of this. Therefore, ECB should only be used for short bits of random text that do not repeat.
- ⚠️ EXAM TIP: ECB is the least secure block mode
CBC (Cipher Block Chaining) — Block mode that uses an initialization vector, making it much more secure than ECB.
CFB (Cipher Feedback) — Block mode that uses an initialization vector, making it much more secure than ECB.
OFB (Output Feedback) — Block mode that uses an initialization vector, making it much more secure than ECB.
CTR (Counter mode) — Considered the best balance of speed and security. It’s not the most secure and it’s slower than ECB, but is the best compromise of speed and security.
- ⚠️ EXAM TIP: CTR provides the best balance of speed and security
Stream ciphers
Stream ciphers — A single bit of plaintext is combined with a single bit from a pseudorandom cipher digit stream (a keystream) using exclusive OR (XOR) math to produce a single bit of ciphertext.
RC4 — The only major stream cipher algorithm that you need to know about. If you get any questions about symmetric stream ciphers, think RC4.
- ⚠️ EXAM TIP: For symmetric stream cipher questions, think RC4
Asymmetric algorithms
Asymmetric algorithms — Use a mathematically related key-pair. Two keys. One key to encrypt and the other to decrypt.
Private key — One key in the key pair which we must keep absolutely private and not share with anyone ever, under any circumstances.
Public key — The other key in the key pair, which we give to anyone and everyone.
Key distribution solution — Asymmetric cryptography solves the key distribution problem by allowing us to securely and efficiently distribute symmetric keys.
Scalability solution — The number of asymmetric keys we need only grows linearly and not exponentially — solving the scalability problem.
Performance downside — Asymmetric cryptography is slow. Like REALLY slow. It can be orders of magnitude slower than symmetric cryptography. So, whenever we need to encrypt a lot of data, or we need to encrypt as fast as possible we need to use symmetric cryptography.
Hard math problems
Factoring — It is very easy to multiply two large prime numbers together and very hard to go backwards and factor the two original prime numbers.
RSA — The asymmetric algorithm that relies on factoring as the hard math problem.
Discrete logs — It is easy to exponentiate, and again much more difficult to go backwards and find the original integers.
Diffie-Hellman (key exchange) — Used to securely exchange symmetric cryptographic keys over an insecure channel – for example the Internet. Relies on discrete logs as the hard math problem.
ECC (Elliptic Curve Cryptography) — Can provide the same strength encryption as RSA, but with a much shorter key, thus ECC is more efficient. The main thing you need to remember about it is that ECC is very efficient as far as asymmetric algorithms go. Relies on discrete logs as the hard math problem.
El Gamal — Asymmetric algorithm which uses discrete logs as the hard math problem.
DSA (Digital Signature Algorithm) — As the name implies, is used for creating digital signatures. Relies on discrete logs as the hard math problem.
Knapsack — Another hard math problem that has significant issues found with using it as the hard math problem and therefore it should NOT be used.
- ⚠️ EXAM TIP: Knapsack should NOT be used due to significant issues
Digital Certificates — An extremely useful tool that asymmetric cryptography enables which allow us to verify the owner of a public key.
Digital Signatures — Provide integrity, authenticity and non-repudiation of both origin and delivery.
Substitution
Substitution — Simply substituting/replacing one character with another one. So, substituting a C for a D, an A for an O, and a T for a G and suddenly a cat has turned into a dog.
Caesar Cipher — One of the earliest known examples of a substitution cipher aptly named after its inventor Julius Caesar. In the Caesar cipher letters are substituted for the letter three places to the right in the alphabet.
Monoalphabetic — Monoalphabetic Ciphers use just one alphabet for the substitution. There is a fixed substitution/replacement structure where if a B is replaced with an X it will always be replaced with an X — this leads to patterns. And patterns must always be avoided in cryptography. The Caesar cipher is an example of a Monoalphabetic Substitution Cipher.
Polyalphabetic — Polyalphabetic Substitution Ciphers use multiple substitution alphabets and thus helps to reduce patterns.
Running key cipher — A substitution cipher in which text, typically from a book, is used to provide a very long keystream to draw the substituted letters from.
One-time pads — A one-time pre-shared key is required – basically a big long string of truly random characters that is at least as long as the text to be encrypted. Each character of the message, the plaintext, is encrypted by combining it with the corresponding character from the one time pad using modular addition. When done properly, using a truly random one-time pad and never reusing, it provides unbreakable encryption.
Transposition
Transposition — Simply rearranging all the letters in the plaintext.
Spartan Scytale — One of the earliest known examples of a transposition cipher. You would take a stick of wood with a very precise diameter and wrap a thin piece of leather around the stick and then write your message on the piece of leather. When you unwrapped the strip of leather your letters would be transposed and your message encrypted. The receiver would have to wrap the strip of leather around the exact same diameter stick to decrypt the message.
Rail Fence/Zigzag — Another method of transposing letters. The plaintext is written in a zigzag pattern into a table and then the letters are copied out row by row thus transposing them.