Comptia Security+ 601 Chapter 7 Summary

CompTIA Security+ Study Guide: Exam SY0-601 8th Edition, by Mike Chapple & David Seidl


Chapter 7 summary of my notes.


Cryptography = encoding information in a manner that it cannot be decoded without access to the decryption key.


Encryption =  transforms plain-text information into ciphertext using an encryption key


Decryption = transforms ciphertext back into plain text using a decryption key.


Cryptography goals:



  1. Confidentiality

  2. Integrity, ensuring data is not altered without authorization

  3. Authentication, the goals of cryptography begin to differ from the CIA triad. Although authentication begins with the letter A, remember that the A in the CIA triad is “availability.” Authentication refers to uses of encryption to validate the identity of individuals.

  4. Nonrepudiation ensures that individuals can prove to a third party that a message came from its purported sender.


Cipher = method used to scramble or obfuscate characters to hide their value.


Ciphering = process of using a cipher to do that type of scrambling to a message.


Substitution cipher = cipher that changes one character or symbol into another.


Polyalphabetic substitution ciphers = use multiple substitution alphabets for the same message.


Transposition cipher = transposing or scrambling the letters in a certain manner.


Steganography = hiding data in image files by making alterations to the least significant bits.


Symmetric cryptosystems use a shared secret key available to all users of the cryptosystem.


Asymmetric cryptosystems use individual combinations of public and private keys for each user of the system.


Data in transit is also called data on the wire


Data at rest, or stored data, = that which resides in a permanent location awaiting access.


Data in motion, or data on the wire, = data being transmitted across a network between two systems.


Data in use = data that is stored in the active memory of a computer system where it may be accessed by a process running on that system.


Obfuscation = making data intentionally difficult for humans to understand.


Message integrity is enforced through the use of encrypted message digests, digital signatures, created upon transmission of a message.


Key = nothing more than a number, usually a very large binary number.


Every algorithm has a specific key space. The key space is the range of values that are valid for use as a key for a specific algorithm. A key space is defined by its key length. Key length is nothing more than the number of binary bits (0s and 1s) in the key. The key space is the range between the key that has all 0s and the key that has all 1s.


Kerchoff principle/assumption,= a cryptographic system should be secure even if everything about the system, except the key, is public knowledge.


Cryptography = creating and implementing secret codes and ciphers.


Cryptanalysis = the study of methods to defeat codes and ciphers.


Cryptology = Cryptography and Cryptanalysis.


Ciphers = algorithms used to perform encryption and decryption operations.


Cipher Suites = sets of ciphers and key lengths supported by a system.


Block ciphers operate on blocks, chunks, of a message and apply the encryption algorithm to an entire message block at the same time.


Stream ciphers operate on one character or bit of a message (or data stream) at a time.


Modern cryptographic systems use at least a 128-bit key to protect data against prying eyes.


The length of the key directly relates to the work function of the cryptosystem.


The longer the key, the harder it is to break the cryptosystem.


Symmetric key cryptography = secret key cryptography or private key cryptography.


Symmetric key encryption is very fast, often 1,000 to 10,000 times faster than asymmetric algorithms.


the word private is stretched to refer to two people sharing a secret that they keep confidential.


Symmetric key cryptography has several weaknesses:



  1. Key distribution is a major problem. Parties must have a secure method of exchanging the secret key before establishing communications with a symmetric key protocol.

  2. Symmetric key cryptography does not implement nonrepudiation.  Because any communicating party can encrypt and decrypt messages with the shared secret key, there is no way to prove where a given message originated.

  3. The algorithm is not scalable.

  4. Keys must be regenerated often. Each time a participant leaves the group, all keys known by that participant must be discarded.


Asymmetric key algorithms or public key algorithms provide a solution to the weaknesses of symmetric key encryption.


Each user has two keys: a public key, which is shared with all users, and a private key, which is kept secret and known only to the owner of the keypair. Opposite and related keys must be used in tandem to encrypt and decrypt / if the public key encrypts a message, then only the corresponding private key can decrypt it, and vice versa.


Major strengths of asymmetric key cryptography:



  1. addition of new users requires the generation of only one public-private key pair.  This same key pair is used to communicate with all users of the asymmetric cryptosystem.

  2. Users can be removed far more easily from asymmetric systems.  Asymmetric cryptosystems provide a key revocation mechanism that allows a key to be canceled, effectively removing a user from the system.

  3. Key regeneration is required only when a user's private key is compromised.

  4. Asymmetric key encryption can provide integrity, authentication, and nonrepudiation.

  5. Key distribution is a simple process.

  6. No preexisting communication link needs to exist. Two individuals can begin communicating securely from the start of their communication session.


The major weakness of public key cryptography = slow speed of operation.


Collision = when hash function produces same value for two different sets of data


Data Encryption Standard (DES), Triple DES (3DES), and the Advanced Encryption Standard (AES).


There are four versions of 3DES:



  1. DES-EE3 = encrypts the plaintext three times with three different keys

  2. DES-EDE3 = uses three keys but replaces the second encryption with a decryption operation.

  3. 3DES (DES-EEE2) = uses two keys

  4. 3DES (DES-EDE2) = uses two keys but uses a decryption operation in the middle


Both third and fourth variants have an effective key length of 112 bits.


AES cipher allows key length of 128 bits, 192 bits, and 256 bits.


AES uses a block size equal to the key length.


128-bit keys require 10 rounds of encryption.


192-bit keys require 12 rounds of encryption.


256-bit keys require 14 rounds of encryption.


Key management practices = safeguards surrounding the creation, distribution, storage, destruction, recovery, and escrow of secret keys.


Key exchange, one of the major problems underlying symmetric encryption algorithms, is the secure distribution of the secret keys required to operate the algorithms. The three main methods used:



  1. Offline distribution

  2. Public key encryption

  3. Diffie–Hellman key exchange algorithm.


Diffie–Hellman is used if there is no way to physically distribute a key offline or if there is no public key encryption infrastructure in place.


Two approaches to key escrow:



  1. Fair Cryptosystems = secret keys used in a communication are divided into two or more pieces, each of which is given to an independent third party.

  2. Escrowed Encryption Standard = provides the government with a technological means to decrypt ciphertext. This standard is the basis behind the Skipjack algorithm.


Key generation is based on the complexity of factoring large prime numbers.


Longer keys are more secure but require more computational overhead.


If you want to encrypt a message, use the recipient's public key.


If you want to decrypt a message sent to you, use your private key.


If you want to digitally sign a message you are sending to someone else, use your private key.


If you want to verify the signature on a message sent by someone else, use the sender's public key.


Hash functions generate message digests(or hash, hash value, checksum) of data.


There are five basic requirements for a cryptographic hash function:



  1. They accept an input of any length.

  2. They produce an output of a fixed length, regardless of the length of the input.

  3. The hash value is relatively easy to compute.

  4. The hash function is one-way (meaning that it is extremely hard to determine the input when provided with the output). The hash function is collision free (meaning that it is extremely hard to find two messages that produce the same hash value).


Secure Hash Algorithm (SHA) and its successors, SHA-1, SHA-2, and SHA-3, are government standard hash functions.


SHA-1 takes an input of virtually any length and produces a 160-bit message digest.


SHA-1 processes a message in 512-bit blocks.


SHA-1 was demonstrated to have vulnerabilities so SHA-2 was adopted as new standard.


SHA-2 has four variants:



  1. SHA-256 produces a 256-bit message digest using a 512-bit block size.

  2. SHA-224 uses a truncated version of the SHA-256 hash to produce a 224-bit message digest using a 512-bit block size.

  3. SHA-512 produces a 512-bit message digest using a 1,024-bit block size.

  4. SHA-384 uses a truncated version of the SHA-512 hash to produce a 384-bit digest using a 1,024-bit block size.


MD5 algorithm is subject to collisions, preventing its use for ensuring message integrity.


Digitally signed messages = assure the recipient that message truly came from the claimed sender and that the message was not altered.


Software is usually digitally signed to authenticate code distribution.


Hashed Message Authentication Code, HMAC, algorithm implements a partial digital signature—it guarantees the integrity of a message during transmission. Because it relies on a shared secret key, it does not provide nonrepudiation.


Digital Signature Standard (DSS). This document specifies that all federally approved digital signature algorithms must use the SHA-3 hashing functions.


DSS also specifies the encryption algorithms that can be used to support a digital signature infrastructure. There are three currently approved standard encryption algorithms:



  1. The Digital Signature Algorithm (DSA) as specified in FIPS 186-4

  2. The Rivest, Shamir, Adleman (RSA) algorithm as specified in ANSI X9.31

  3. The Elliptic Curve DSA (ECDSA) as specified in ANSI X9.62


The Public key infrastructure (PKI) hierarchy of trust relationships permit combining asymmetric cryptography with symmetric cryptography along with hashing and digital certificates, giving us hybrid cryptography.


Digital certificates = essentially endorsed copies of an individual's public key.


Digital certificates are governed by an international standard—X.509 and contain the following:



  1. Serial number (from the certificate creator)

  2. Signature algorithm identifier (specifies the technique used by the certificate authority to digitally sign the contents of the certificate)

  3. Issuer name (identification of the certificate authority that issued the certificate)

  4. Validity period (specifies the dates and times—a starting date and time and an expiration date and time—during which the certificate is valid) Subject's Common Name (CN) that clearly describes the certificate owner (e.g., “certmike.com”)

  5. Subject Alternative Names (SAN) that allow you to specify additional items (IP addresses, domain names, and so on) to be protected by the single certificate.

  6. Subject's public key (the meat of the certificate—the actual public key the certificate owner used to set up secure communications)


The subject of a certificate may include a wildcard in the certificate name, indicating that the certificate is good for subdomains as well. The wildcard is designated by an asterisk character. For example, a wildcard certificate issued to *. certmike.com would be valid for all of the following domains: certmike.com www.certmike.com mail.certmike.com secure.certmike.com


Wildcard certificates are only good for one level of subdomain. *. certmike.com would not be valid for the www.cissp.certmike.com subdomain.


Certificate authorities (CAs) are the glue that binds the public key infrastructure together. These neutral organizations offer notarization services for digital certificates. To obtain a digital certificate from a reputable CA, you must prove your identity to the satisfaction of the CA.


PKI relies on a hierarchy of trust relationships.


Registration authorities, RAs, assist CAs with verifying users' identities prior to issuing digital certificates.


CAs often use an offline CA to protect their root certificate, the top-level certificate for their entire PKI.


This offline CA is disconnected from networks and powered down until it is needed. The offline CA uses the root certificate to create subordinate intermediate CAs that serve as the online CAs used to issue certificates on a routine basis.


In the CA trust model, the use of a series of intermediate CAs = certificate chaining. To validate a certificate, the browser verifies the identity of the intermediate CA(s) first and then traces the path of trust back to a known root CA, verifying the identity of each link in the chain of trust.


Many organizations operate internal CAs that provide self-signed certificates for use inside an organization. These certificates won't be trusted by the browsers of external users, but internal systems may be configured to trust the internal CA, saving the expense of obtaining certificates from a third-party CA.


Enrollment = proving your identity to a CA after requesting a digital certificate with a Certificate Signing Request, CSR.


CA creates a X.509 compliant digital certificate using the CSR(your identity and public key) and signs the certificate using their own private key.


Domain Validation, DV, certificates = CA simply verifies the certificate subject has control of the domain name.


Extended Validation, EV, certificates = CA takes extra measures to ensure your identity as a business.


CA might revoke a certificate:



  1. The certificate was compromised

  2. The certificate was erroneously issued

  3. The details of the certificate changed

  4. The security association changed


Three techniques to verify the authenticity of certificates and identify revoked certificates:



  1. Certificate Revocation Lists, CRLs, are maintained by the various certificate authorities and contain the serial numbers of certificates that have been issued by a CA and have been revoked along with the date and time the revocation went into effect.

  2. Online Certificate Status Protocol, OCSP, eliminates the latency inherent in the use of certificate revocation lists by providing a means for real-time certificate verification.

  3. Certificate Stapling = web server contacts the OCSP server and receives a signed and timestamped response from the OCSP server, which it then attaches, or staples, to the digital certificate. When a user requests a secure web connection, the web server sends the certificate with the stapled OCSP response to the user. The user's browser then verifies that the certificate is authentic and also validates that the stapled OCSP response is genuine and recent.


Distinguished Encoding Rules, DER, = binary format for a certificate file.


DER certificates are normally stored in files with the .DER, .CRT, or .CER extensions.


The Privacy Enhanced Mail, PEM, certificate format is an ASCII text version of the DER format.


PEM certificates are normally stored in files with the .PEM or .CRT extensions.


The Personal Information Exchange, PFX, format is commonly used by Windows systems. PFX certificates may be stored in binary form, using either .PFX or .P12 file extensions.


Frequency analysis involves looking at the blocks of an encrypted message to determine if any common patterns exist.


Known Plain Text = relies on the attacker having pairs of known plain text along with the corresponding ciphertext. This gives the attacker a place to start attempting to derive the key.


Chosen Plain Text = the attacker obtains the ciphertexts corresponding to a set of plain texts of their own choosing. This allows the attacker to attempt to derive the key used and thus decrypt other messages encrypted with that key.


Related Key Attack = the attacker can obtain cipher texts encrypted under two different keys.


Birthday Attack = attack on cryptographic hashes, based on something called the birthday theorem.


Downgrade attack = sometimes used against secure communications such as TLS in an attempt to get the user or system to inadvertently shift to less secure cryptographic modes.


Tor, formerly known as The Onion Router, = anonymously routing traffic across the Internet using encryption and a set of relay nodes. It relies upon a technology known as perfect forward secrecy, where layers of encryption prevent nodes in the relay chain from reading anything other than the specific information they need to accept and forward the traffic.


Blockchain = a distributed and immutable public ledger.


Dedicated VPN hardware device may contain cryptographic hardware that implements encryption and decryption operations in highly efficient form to maximize speed.