Hands-On Ethical Hacking and Network Defense, Third Edition 12-1
Chapter 12
Cryptography
At a Glance
Instructor’s Manual Table of Contents
Overview
Objectives
Teaching Tips
Quick Quizzes
Hands-On Ethical Hacking and Network Defense, Third Edition 12-2
Lecture Notes
Overview
This chapter describes the history of cryptography. It also explains several symmetric and
asymmetric cryptography algorithms. Students will learn about the similarities and differences
between symmetric and asymmetric cryptography. The chapter also explains public key
infrastructure (PKI) and when it is appropriate to use. Students will learn about possible attacks
to cryptosystems and also compare hashing algorithms.
Chapter Objectives
After reading this chapter and completing the exercises, the student will be able to:
Summarize the history and principles of cryptography
Describe symmetric and asymmetric encryption algorithms
Explain public key infrastructure (PKI)
Describe possible attacks on cryptosystems
Compare hashing algorithms and how they ensure data integrity
Teaching Tips
Understanding Cryptography Basics
1. This section will cover basic aspects of cryptography. Cryptography is the process of
History of Cryptography
2. Describe substitution cipher as a type of cryptography that replaces one letter with
3. Explain cryptanalysis and its role in proving that an encryption algorithm cannot be
Hands-On Ethical Hacking and Network Defense, Third Edition 12-3
The War Machines
1. Describe Enigma, a substitution ciphering machine developed and used by the
Germans, and its role during World War II.
2. Provide an overview of the Purple Machine, another ciphering machine based on the
3. Define and explain steganography.
Teaching
Tip
Find more information about these machines at the following links:
http://www.bbc.co.uk/history/topics/enigma
http://www.codesandciphers.org.uk/enigma/
Understanding Symmetric and Asymmetric Algorithms
2. Describe the importance of selecting a good random key and keeping it secret.
Symmetric Algorithms
1. Define symmetric algorithms as algorithms that use the same key for data encryption
and decryption.
3. Explain the main advantages of symmetric algorithms, as described in the book.
4. Describe the two types of symmetric algorithms currently in use: stream ciphers and
Hands-On Ethical Hacking and Network Defense, Third Edition 12-4
Tip
Data Encryption Standard
2. Describe Lucifer, the 128-bit encryption algorithm developed by IBM that won the
contest organized by the NIST.
3. Explain the modification to the key size that the National Security Agency (NSA) made
to Lucifer before adopting it as the official Data Encryption Algorithm (DEA).
Security
Tip
Check out http://lasecwww.epfl.ch/memo/memo_des.shtml to learn six ways to
break DES.
Triple DES
Advanced Encryption Standard
International Data Encryption Algorithm
1. Describe the main characteristics of IDEA, including its block size and key size.
Blowfish
1. Describe the main characteristics of Blowfish, including its block size and key size.
Hands-On Ethical Hacking and Network Defense, Third Edition 12-5
Asymmetric Algorithms
1. Explain the basics of asymmetric algorithms. Asymmetric algorithms use two keys that
2. Introduce the concept of public and private keys and explain how they can be used to
encrypt and decrypt a message with integrity and confidentiality.
RSA
1. Describe RSA, an asymmetric algorithm developed in 1978 by Ronald L. Rivest, Adi
Shamir, and Leonard M. Adleman.
Diffie-Hellman
1. Describe how Diffie-Hellman can be used for secure key distribution.
2. Emphasize that the Diffie-Hellman does not provide encryption.
Elliptic Curve Cryptography
ElGamal
1. Describe the main characteristics of Elgamal, another public key algorithm used to
encrypt data, create digital signatures, and exchange secret keys.
Security
Tip
Read https://technet.microsoft.com/en-us/library/aa998077(v=exchg.65).aspx
for an article on public key cryptography.
Digital Signatures
1. Explain how digital signatures employ asymmetric algorithms to provide message
integrity, authenticity and nonrepudiation.
Hands-On Ethical Hacking and Network Defense, Third Edition 12-6
Digital Signature Standard
1. Describe federal government requirements for verifying digital signatures using
Pretty Good Privacy
1. Introduce PGP as a free e-mail encryption program developed by Phil Zimmerman and
explain its main characteristics.
Secure Multipurpose Internet Mail Extension
Sensitive Data Encryption
Hashing Algorithms
2. Introduce Message Digest 5 (MD5) and Secure Hash Algorithm (SHA-1). Explain the
Quick Quiz 1
1. A key is a sequence of random bits generated from a range of allowable values and is
called which of the following?
A. algorithm
B. encryption
C. keyspace
D. cryptosystem
2. What are the two types of symmetric algorithms that are currently used? Choose two.
A. public
B. block
C. private
D. stream
3. Which of the following is a way of hiding data in plain view in pictures, graphics, or
text?
A. authenticity
B. steganography
C. encryption
D. cipher
4. True or False: Symmetric algorithms use two keys that are mathematically related, so
data encrypted with one key can be decrypted only with the other key.
5. A function that takes a variable-length string or message and produces a fixed-length
value called a message digest is known as which of the following?
A. hashing algorithm
B. cryptography
C. encryption
D. digital signature
Understanding Public Key Infrastructure (PKI)
1. Explain that PKI is not an algorithm; it’s a structure consisting of programs, protocols,
and security policies for encrypting data and uses public key cryptography to protect
Components of PKI
1. Define a certificate as a digital document that verifies that the two parties exchanging
data over the Internet are really who they claim to be.
Expiring, Revoking, and Suspending Certificates
1. Mention that certificates have expiration dates and describe the requirements to renew a
2. Describe the reasons for revoking a certificate and describe the process of revocation.
HTTP Strict Transport Security
1. Explain that HSTS was created in 2012 as a mechanism for Web servers to tell clients
they require secure communications.
2. Describe the two things HSTS does to promote secure client-server communications:
a. It forces all traffic between a Web browser and a Web server to be sent over a
Backing Up Keys
Microsoft Root CA
1. Describe and explain the steps for configuring a Root CA in Windows Server 2008r.
Understanding Cryptography Attacks
Birthday Attack
1. Explain how birthday attacks can be used to find mathematical weakness in hashing
algorithms.
Teaching
Tip
Check out http://mathworld.wolfram.com/BirthdayProblem.html for a way to
solve the birthday problem.
Hands-On Ethical Hacking and Network Defense, Third Edition 12-9
Mathematical Attacks
1. Define the categories of mathematical attacks:
a. Ciphertext-only attack
2. Explain the differences between these categories of attacks.
Brute-Force Attack
1. Describe how a brute force attack can be used to guess passwords by trying every
Man-in-the-Middle Attack
2. Describe the complete process for conducting a Man-in-the-Middle attack.
Teaching
Tip
Read more about the Man-in-the-Middle attack at
http://www.tomsguide.com/us/man-in-the-middle-attack,news-17755.html
SSL/TLS Downgrade Attack
1. Explain that with a SSL/TLS downgrade attack, an attacker who intercepts the initial
2. Point out to students that the fix for this issue was to make sure all ciphers allowed by a
server are secure.
Dictionary Attack
Replay Attack
1. Define a replay attack as a type of attack where the attacker captures data and attempts
to resubmit the captured data, so that the device thinks a legitimate connection is in
effect.
Hands-On Ethical Hacking and Network Defense, Third Edition 1210
Understanding Password Cracking
1. Mention that cracking passwords is illegal in the United States.
2. Describe the general steps for cracking passwords:
3. Mention that there are several password cracking programs, including:
a. Hashcat
Quick Quiz 2
1. True or False: PKI is not an algorithm; rather, it’s a structure or base that consists of
programs, protocols, and security policies.
2. Which of the following is a digital document that verifies that two parties exchanging
data over the Internet are really who they claim to be?
A. public key
B. ciphertext
C. certificate
D. rainbow table
3. True or False: Passive attacks attempt to determine the secret key being used to encrypt
plaintext.
4. In which type of attack does an attacker use a password-cracking program, such as John
the Ripper, to guess passwords by attempting every possible combination of letters?
A. Man-in-the-Middle
B. Brute-force
C. Dictionary
D. Replay
5. In which type of attack does the attacker capture data and attempt to resubmit the
captured data so that the device thinks a legitimate connection is in effect?
A. Man-in-the-Middle
B. Brute-force
C. Dictionary
D. Replay
Class Discussion Topics
1. What is Frequency Analysis and how can it be used against simple substitution ciphers
such as the Caesar cipher?
Additional Projects
1. Ask your students to implement their own Caesar cipher programs. They can use any
programming language, such as C, C++, or Java. The program should receive an input
2. Ask your students to investigate one-time pad ciphers and prepare an example of how to
Additional Resources
1. Introduction to Codes, Ciphers, and Codebreaking:
2. The Legacy of DES:
3. What is Elgamal Cryptosystem?:
4. Why Textbook ElGamal and RSA Encryption are Insecure:
5. Using the Windows Certificate Viewer:
Key Terms
See Glossary for definitions of Key Terms.
Advanced Encryption Standard (AES)
asymmetric algorithm
certificate
certification authority
cipher
ciphertext
cryptanalysis
cryptosystem
data at rest
Data Encryption Algorithm (DEA)
Data Encryption Standard (DES)
Hands-On Ethical Hacking and Network Defense, Third Edition 1214
Technical Notes for Activities
Activity 12-1: This activity requires paper and pencil.
Activity 12-2: This activity requires a computer running Windows, an Internet
connection, and a Web browser.