CS260 Study Guide
Site: | Saylor Academy |
Course: | CS260: Introduction to Cryptography and Network Security |
Book: | CS260 Study Guide |
Printed by: | Guest user |
Date: | Monday, 28 April 2025, 5:55 AM |
Table of contents
- Navigating this Study Guide
- Unit 1: Introduction to Cryptography
- Unit 2: Hash Functions
- Unit 3: Symmetric Encryption
- Unit 4: Asymmetric Encryption
- Unit 5: Signatures and Certificates
- Unit 6: Key Management
- Unit 7: Elliptic Curve Cryptography
- Unit 8: Zero Knowledge Proofs
- Unit 9: Quantum Key Distribution
- Unit 10: Quantum Algorithms
Navigating this Study Guide
Study Guide Structure
In this study guide, the sections in each unit (1a., 1b., etc.) are the learning outcomes of that unit.
Beneath each learning outcome are:
- questions for you to answer independently;
- a brief summary of the learning outcome topic; and
- and resources related to the learning outcome.
At the end of each unit, there is also a list of suggested vocabulary words.
How to Use this Study Guide
- Review the entire course by reading the learning outcome summaries and suggested resources.
- Test your understanding of the course information by answering questions related to each unit learning outcome and defining and memorizing the vocabulary words at the end of each unit.
By clicking on the gear button on the top right of the screen, you can print the study guide. Then you can make notes, highlight, and underline as you work.
Through reviewing and completing the study guide, you should gain a deeper understanding of each learning outcome in the course and be better prepared for the final exam!
Unit 1: Introduction to Cryptography
1a. Identify characteristics of a computationally secure system
- What is cryptography?
- What is a computationally secure system?
- Why are confidentiality, integrity, and authentication key terms for the field of cryptography?
Cryptography is the science of converting plaintext messages to ciphertext. Once such codes are created, some adversary will inevitably attempt to recover the plaintext from the ciphertext. Therefore, it is imperative to understand the basic principles of security. For example, Kerckhoff's Principle states that cryptographic systems should remain secure even when the attacker knows all the internal details of the system. Computational security is the confidence that adversarial determination of the plaintext from the ciphertext is beyond current computational capabilities.
The concepts of confidentiality, integrity, and authentication are central to the theme of security. Confidentiality is the property that prevents adversaries from reading your private data and allows access only to the intended recipient. Authentication is the process of verifying the identity of a user, process, or device, and allows you to determine who created a given message. Integrity is the property that prevents adversaries from tampering with private data, assuring that the data received is identical to the data sent. Network security principles such as these allow you to precisely define architectures for specific applications.
To review, see:
1b. Explain the difference between a block cipher and a stream cipher
- What is a block cipher?
- What is a stream cipher?
- How can confusion and diffusion be achieved?
Cryptographic systems process data either by breaking it into blocks (via block ciphers) or by processing longer streams of data (via stream ciphers). Block ciphers encrypt blocks of data, while stream ciphers encrypt streams of data.
Confusion is the process of obscuring the relationship between the ciphertext and the key. Both stream ciphers and block ciphers can achieve confusion. One way to achieve confusion is to use a substitution cipher, which substitutes one plaintext symbol for another. On the other hand, diffusion is the process of obscuring any relationship between the plaintext and the ciphertext. Given the stream ciphers introduced in this course, only block ciphers can achieve diffusion. One way to achieve diffusion is to use a transposition cipher.
To review, see:
1c. Solve problems involving substitution ciphers
- What is a substitution cipher?
- How does a Caesar cipher work?
- How does a Vernam cipher work?
Substitution ciphers lie at the core of many cryptosystems. The key is instrumental in defining the substitution. For example, in a Caesar cipher, letters are substituted using a shift of the alphabet. In general, the key could be a permutation of the whole alphabet (the alphabet shift is a special case). This means that, when using the English alphabet, there are 26 factorial possible permutations that could serve as key candidates.
Another important example is the Vernam cipher, which involves applying a bitwise logical exclusive-or between the plaintext bit stream and a key derived from a random number. Substitution can be useful for achieving confusion and is an operation that is fundamental to cryptography. Based on the material in this unit, you should be able to solve basic problems using the Caesar cipher and the Vernam cipher.
To review, see:
1d. Solve problems involving transposition ciphers
- What is a transposition cipher?
- How does a rail fence cipher work?
- How does a columnar transposition cipher work?
In contrast to substitution ciphers, transposition ciphers permute the plaintext symbols, rearranging the characters according to a specific pattern or key without altering the characters themselves. This mixing effect can be powerful if the permutation is applied to a long plaintext stream. Transpositions can be useful for achieving diffusion. The rail fence cipher and columnar transposition cipher are two examples of how to apply permutations methodically. Rail fence ciphers achieve the desired mixing of the symbols by grouping every nth symbol and then concatenating all the groups to form the ciphertext. Columnar transpositions read the plaintext into a matrix column-wise and form the ciphertext by reading out the rows of the matrix. Make sure you understand how the key is used to decrypt the encrypted messages. When substitution is mixed with transposition, powerful cryptosystems can be devised. Based on the material in this unit, you should be able to solve basic problems using the rail fence cipher and the columnar transposition cipher.
To review, see:
1e. Describe the concept of perfect secrecy
- What is perfect secrecy?
- How does perfect secrecy differ from computational security?
- How does a one-time pad achieve perfect secrecy?
Perfect secrecy is the condition where, after observing the ciphertext, an adversary can gain no information about the plaintext. Shannon's Maxim is the principle that systems should be designed under the assumption that the enemy will immediately gain full familiarity with them and, therefore, rely on the security of the key over the algorithm. It can be difficult to prove that a given encryption technique achieves perfect secrecy. This is why computational security is so important. Given assumptions about present computational power, it is generally easier to demonstrate that a given cipher cannot be broken. Therefore, most cryptosystems are characterized in terms of their computational security.
The Vernam cipher is a stream cipher that combines the stream of message bits with a stream of a random bit sequence. It is one famous example of a system demonstrated to achieve perfect secrecy. If the key, which is a random bit stream, is long enough and used only once, this cipher can achieve perfect secrecy. When the key is used only one time, the Vernam cipher is referred to as the one-time pad. The Vernam cipher is a stream cipher and a substitution cipher that, due to the randomness of the key, can destroy any relationship between the ciphertext and the key. This is why perfect secrecy can be achieved.
To review, see:
Unit 1 Vocabulary
This vocabulary list includes terms you will need to know to successfully complete the final exam.
- authentication
- block cipher
- computational security
- confidentiality
- confusion
- diffusion
- integrity
- Kerckhoff's Principle
- one-time pad
- perfect secrecy
- Shannon's Maxim
- stream cipher
- substitution cipher
- transposition cipher
- Vernam cipher
Unit 2: Hash Functions
2a. Define the meaning of a one-way function
- What is a one-way function?
- How are one-way functions useful for constructing hash functions?
- What is an inverse image?
- What is preimage resistance?
A function over some domain takes input values where, for every input value x, there is one and only one output value y. The inverse image of a value
is the set of values x that can be recovered from y. Therefore, every output value y of a function always has an inverse image associated with it. A one-way function is a function where it is relatively easy to compute
but computationally infeasible to compute the inverse image. Hash functions are deterministic one-way functions that convert variable length messages to fixed length codes. Such constructions are useful for designing hash functions because the goal is to create a fixed-length code from a variable-length message where the code:
- is easy to compute and
- cannot be used to determine the original message.
The one-way property of hash functions is often also referred to as the preimage resistance property.
To review, see:
2b. Explain collision resistance
- What is collision resistance?
- How does the pigeonhole principle apply to hash functions?
- What is the difference between collision resistance and second preimage resistance?
- What is the avalanche effect?
The goal of a hash function is to take variable-length messages and map them into fixed-length codes. In practical applications, most messages will be much longer than the fixed-length code. The pigeonhole principle automatically implies that two different messages will inevitably be mapped into the same code (that is, a "collision" will occur). Collision resistance is where a hash function must be resistant to finding such collisions.
Second preimage resistance is defined as follows: Given a preimage x and its hash value , it should be computationally infeasible to find a second preimage y such that
where yx. Second preimage resistance is a weaker form of collision resistance. A stronger statement is to say that it is computationally infeasible to find any pair (x,y) where
, which is the definition of collision resistance. The avalanche effect, also an important concept for hash functions, is where a small change in the message results in a large change in the hash value (this property is sometimes referred to as "near-collision resistance").
To review, see:
2c. Explain how hash functions are applied in practice
- What is a blockchain?
- How are hash functions applied in practice?
- What is "proof of work"?
A blockchain is a digital ledger that keeps track of transactions by successively adding consecutive records in the form of a "chain". Hash functions are central to the construction of a blockchain because a hash of a previous transaction record (a "block") is integrated into the next transaction record. Using this construction, if any block in the blockchain is altered, all subsequent blocks would have to be altered for subsequent hashes to encompass the alteration. However, since many copies of the blockchain exist, this implies that at least 51 percent of all blockchain copies would also have to be altered to give the impression that the modified transaction was valid. The security of a blockchain lies in the computational infeasibility of modifying the hashes and then applying those modifications to 51 percent of all blockchains. The first generation of blockchains applied proof of work to determine the hash of the current transaction combined with the hash of the previous block. As should be clear from the material in this unit, the Secure Hash Algorithm (SHA) is a standard family of hash functions applied in many applications. For example, in the Bitcoin blockchain, a miner is rewarded bitcoins for being the first to find the SHA-256 hash containing a nonce at the beginning of the hash. Finding a valid hash containing a nonce is known as proof of work. Make sure you understand the blockchain concept and how hash functions are applied in this context.
Another important application of hash functions you must recall is user authentication, where a user's information is used to authenticate the user (for example, a password). It is safer for a system to store the hash of a password rather than the password itself. Given the computational difficulty of inverting a hash, recovering a password from the stored hash should be difficult. When a user attempts a login, the hash of the input password can be compared against the stored hash for authentication.
To review, see:
2d. Describe the Merkle-Damgard construction
- How can good hash functions be constructed?
- What is a compression function?
- What are some features of the Merkle-Damgard construction?
Hash functions are one-way functions, so they must be easily computed. At the same time, they must be collision-resistant. One approach to achieving these goals is by iterating a simple compression function a specified number of times. A compression function is a function that outputs a smaller fixed-length hash from a larger input sequence.
The Merkle-Damgard construction is one where a compression function is applied iteratively by creating a hash value from the concatenation of an input block with the hash value of the previous internal unit. Since the original input message is broken up into blocks of fixed length, the final input block is not guaranteed to have the correct length. Therefore, the input message may need to be padded with zeros to achieve the specified length. You should make sure to understand the Merkle-Damgard construction and how the compression converts larger sequences into shorter fixed-length sequences.
To review, see:
2e. Compose programs to implement Secure Hash Algorithm (SHA)
- How can Python be used to implement hash functions?
- What hash functions are included in hashlib?
- What is the Python syntax for computing SHA hashes?
Python modules exist that are useful for cryptographic applications. The hashlib
module is of particular interest as it can be used to implement a variety of Secure Hash Algorithms (SHA), such as SHA256, SHA384, and SHA512. The syntax for setting up hash computation such as SHA256 looks like:
from hashlib import sha256
It is important to understand how to use the method calls within hashlib to compute a given hash. Additionally, it is important to understand how to write code to exhibit the properties of hash functions. For instance, you should be able to write code that demonstrates the avalanche effect or write code that would test for a collision. In this way, you can use the theory of how hash functions work to create practical implementations.
To review, see:
Unit 2 Vocabulary
This vocabulary list includes terms you will need to know to successfully complete the final exam.
- avalanche effect
- blockchain
- collision resistance
- compression function
- hash function
- inverse image
- Merkle-Damgard construction
- one-way function
- preimage resistance
- proof of work
- second preimage resistance
- Secure Hash Algorithm (SHA)
- user authentication
Unit 3: Symmetric Encryption
3a. Explain the features of a symmetric encryption system
- What is symmetric encryption?
- What are some desirable features of a symmetric encryption system?
- What are modes of operation?
The main component of any cryptosystem is the key. In a symmetric cryptosystem, both parties use the same key to encrypt and decrypt a message. Symmetric systems should be able to achieve confusion and diffusion, and you should be familiar with these definitions. Additionally, as symmetric systems can be used to encrypt and communicate large amounts of data, in practice, they tend to be very modular, easy to implement in hardware, and computationally fast.
You should also be familiar with modes of operation for encryption and decryption. One important implementation aspect of symmetric block ciphers is that it is generally not a good idea to use the electronic codebook mode of operation, where each block is encoded in the same way. More sophisticated techniques involve cipher block chaining or the counter mode of operation. These modes help to obscure any underlying relationships that run the risk of appearing in the ciphertext,
To review, see:
3b. Detail the concepts involving the Feistel cipher
- What is a Feistel cipher?
- How does the Feistel cipher achieve diffusion and confusion?
- Why is the Feistel cipher invertible?
The Feistel cipher is a symmetric cipher consisting of rounds of a basic unit responsible for encrypting a message. This basic unit is a round function that achieves confusion and diffusion using substitution and transposition. A fundamental component of this cipher is a pseudo-random function that cannot be inverted.
The Feistel cipher has been used in various ciphers, such as the Data Encryption Standard (DES). The Data Encryption Standard (DES) is a standard developed that uses the Feistel cipher round approach.
A round function is a function that is applied at each round within the Feistel cipher. The Feistel cipher is an example of a modular symmetric system that is easy to implement and computationally fast. A pseudo-random function is a function that is not invertible and outputs a randomized version of its input bits. The Feistel cipher applies a pseudo-random function (which is not invertible), yet the round function is invertible, making it possible to decrypt using the same architecture as the encryption phase. The round function invertibility is due to the bitwise exclusive-or used in tandem with the left-right transpositions. You should be familiar with how the Feistel cipher can be inverted to decrypt a message.
To review, see:
- Combining Transposition and Substitution
- The Elegance of the Feistel Cipher
- Applying the Feistel Cipher
3c. Explain AES and 3DES improvements over DES
- What was a major flaw in the DES system?
- How does 3DES improve upon DES?
- How does AES improve upon AES?
DES became outdated by the mid-1990s, and a major flaw was the 56-bit key size. One important element of a good cryptosystem is a large key space and a brute force search space of size 256 would be considered to be quite small. Triple DES (3DES) applies DES three times and leads to the creation of a 168-bit key. Make sure you understand how 3DES applies DES to encrypt and decrypt a message, and also be clear on how to configure 3DES so that it is backward compatible with DES.
While the 3DES improvement was a sensible one, it was decided by the cryptographic community that a new approach to a symmetric encryption standard was in order. The Advanced Encryption Standard (AES) is a standard developed to improve DES because AES allows for larger key sizes, is more secure, and is more efficient. Make sure to understand how the number of rounds varies with the 128, 192, and 256-bit key sizes. Additionally, make sure to understand how substitution and transposition are integrated into AES.
To review, see:
Unit 3 Vocabulary
This vocabulary list includes terms you will need to know to successfully complete the final exam.
- Advanced Encryption Standard (AES)
- Data Encryption Standard (DES)
- Feistel cipher
- pseudo-random function
- round function
- symmetric cryptosystem
- Triple DES (3DES)
Unit 4: Asymmetric Encryption
4a. Explain the differences between symmetric and asymmetric encryption
- What is asymmetric cryptography?
- How does asymmetric cryptography differ from symmetric cryptography?
- What are some applications of asymmetric cryptography?
Asymmetric cryptography, also known as public key cryptography, is a process where two different keys are used for encryption and decryption. Recall that symmetric cryptography requires all parties to use the same key for encryption and decryption. With asymmetric cryptography, one of the keys is known publicly and does not need to be kept secret. To communicate and maintain confidentiality with a receiver, you encrypt using the receiver's public key and only the receiver can decrypt your message using their own secret, private key.
Public key cryptosystems are usually based upon some number theoretic problem considered computationally difficult to solve (and therefore, assumed to be computationally secure). This unit introduces RSA as the first example of an asymmetric system. Public key systems can be used for encryption for confidentiality, but as subsequent units demonstrate, they can also be used for authentication and as a means for creating digital signatures. They can also be used to distribute keys for use in a symmetric system. This is because symmetric systems tend to be more modular and are intended to be fast for high data throughput. Asymmetric systems tend to be more computationally intensive since they are based upon difficult number theoretic problems. This way, shorter datastreams such as keys can be transmitted using a public key system. Once distributed, a symmetric system can be used for larger datastreams.
To review, see:
4b. Describe how the factoring problem relates to the RSA cryptosystem
- Why is factoring important in the RSA cryptosystem?
- How is factoring used in RSA?
- Why is RSA considered to be computationally secure?
Given a composite integer N, factoring is the process of determining at least one factor of N. The factoring of a composite number is believed to be a computationally difficult problem to solve as the number N becomes large. In addition to the public key, part of the public information used to encrypt in the RSA cryptosystem is a large composite number. If this number can be factored, the private key can be determined, and the ciphertext can be decrypted. As long as factoring is a difficult problem to solve, the RSA system can be considered computationally secure. The number field sieve is the most efficient known classical algorithm for factoring large integers. You should understand the time complexity of algorithms such as a brute force search and the number field sieve.
The private key, d, for RSA, is constructed by choosing a large composite number, N, and a public key, e. You must understand how to create the private key for RSA. The Euler totient function is the number of positive integers less than N that are relatively prime to N. When
is a product of two prime numbers, p and q (which are kept secret), the Euler totient function takes on a very simple form:
. Therefore, if p and q are known, then
is easy to compute. The relationship between the public key, e, and the private key, d, for RSA must obey:
Hence, e and d are multiplicative inverses in the congruence modulo . If e and
are known, then d can be efficiently computed using the extended Euclidean algorithm, and constructing the private key is a straightforward calculation. This is why p and q must be kept secret. To determine the private key when the public key and N are known, either N must be factored, or the Euler totient function of N must be determined. However, factoring N is considered to be computationally difficult using classical computational techniques.
On the other hand, determining the Euler totient function would entail determining the number of positive integers less than N that are relatively prime to N. This problem is at least as difficult as the factoring problem. The Euclidean algorithm is efficient for computing the greatest common divisor of two integers. The extended Euclidean algorithm is efficient for solving the linear Diophantine equation . You must understand how the Euclidean algorithm is used for computing the GCD and how the extended Euclidean algorithm is used to compute the private key.
To review, see:
4c. Apply the RSA cryptosystem
- How do you encrypt a message using RSA?
- How do you decrypt a message using RSA?
- How are encryption and decryption achieved as the numbers become large?
Once the number theory of RSA is understood, encryption and decryption are theoretically quite straightforward. Given a composite number, N, a public key, e, a private key, d, and a message, m, the message is encrypted as:
To decrypt the ciphertext, compute the following:
For small numbers, such a calculation is easily implemented in a language such as Python:
However, as the numbers become large (as they routinely do in cryptographic applications), the exponentiation operation will quickly exceed the numerical precision of most computers. Steps must be taken to deal with this issue. In this course, you must understand the repeated squaring algorithm, a method used to efficiently perform the exponentiation of large numbers by computing repeated squares. You must be able to compute the Euler totient function, understand how to compute private keys, apply the extended Euclidean algorithm to compute private keys, and apply the Euclidean algorithm to compute the GCD.
To review, see:
4d. Compose programs to implement the RSA cryptosystem
- What are the steps to creating the RSA cryptosystem?
- How are these steps implemented in Python?
- How do you connect the theory to implementing the code?
RSA, a public-key encryption algorithm that uses a pair of keys to encrypt and decrypt data, involves three components to achieve confidentiality:
- Key generation: generate public and private keys
- Encryption: exponentiation using the public key
- Decryption: exponentiation using the private key
The theoretical side of RSA means you should understand concepts related to Fermat's little theorem and the Euler totient function. The practical side of RSA means you should understand how to implement the above steps. In other words, you should have code that can compute the Euler totient function, test for primality, factor composite numbers, implement the Euclidean algorithm, implement the extended Euclidean algorithm, and implement the repeated squaring algorithm. Given this suite of tools, you should be able to implement the RSA cryptosystem and run tests to ensure that steps a-c above can be achieved.
To review, see:
Unit 4 Vocabulary
This vocabulary list includes terms you will need to know to successfully complete the final exam.
- asymmetric cryptography
- Euclidean algorithm
- Euler totient function
- extended Euclidean algorithm
- factoring
- number field sieve
- public key cryptography
- repeated squaring algorithm
- RSA
Unit 5: Signatures and Certificates
5a. Explain authentication, confidentiality, and non-repudiation
- What is authentication?
- What is confidentiality?
- What is non-repudiation?
The goal of confidentiality is to ensure the contents of a message cannot be determined by unintended receivers. This course emphasizes encryption techniques to ensure confidentiality. Authentication means that a receiver can verify the source of a message. Here, the terminology has the potential to be confusing. Integrity refers to when a message can be verified that it has not been modified. To be sure, sender authentication attempts to verify the source of a message, and message integrity attempts to authenticate message content. Message authentication codes (MAC) are codes derived from a message that can be used to achieve integrity and authentication. Finally, non-repudiation means that a sender cannot deny sending a message (it can also mean a receiver cannot deny receiving a message). Digital signatures can be used to achieve non-repudiation. Make sure to understand the importance of these definitions in network security applications. Additionally, make sure you understand how hash functions, symmetric cryptography, and public key cryptography in various configurations can be used to achieve authentication, confidentiality, and non-repudiation.
To review, see:
5b. Apply architectures for message integrity
- What is a message authentication code?
- How are MACs used in practice?
- How are MACs implemented?
With an understanding of how to implement hash functions, symmetric cryptography, and asymmetric cryptography, it is now sensible to apply them in a larger context. Given the definitions of confidentiality, integrity, and authentication, it is important to understand how to devise configurations (or "architectures") that can achieve these characteristics in network security applications. One major step to going beyond encryption for confidentiality is to understand how to implement a system to achieve message integrity and sender authentication. This is because messages need not always be confidential, but you would still like to be able to verify the message contents have not been altered. For example, you could send a message M along with an encrypted version E(K,M) using a symmetric system. Assuming the receiver has the key K, the decrypted contents D(K,M) can be compared with the received message. Thus, E(K,M) can be used as a message authentication code (MAC) where E(K,M) is the authenticator. This scheme authenticates the message and authenticates the sender (assuming only the sender and receiver have the key, K). You should understand how different architectures can be used to construct MACs.
To review, see:
5c. Explain keyed hash functions
- What is a keyed hash function?
- Why are keyed hash functions useful?
- How are keyed hash functions implemented?
When designing MACs, the prevailing school of thought is that hash functions run faster than typical encryption methods for use as the authenticator. Furthermore, as you have already seen, libraries for implementing hash functions are readily available. Keyed hash functions are simply hash functions that require extra secret knowledge (such as a key) to encode the message hash. Such an approach can be as simple as encrypting the hash of a message. The HMAC is a standard devised by NIST for designing keyed hash functions. A popular example of a standard keyed hash function is HMAC RFC 2104. You should understand how keyed hash function implementations can be used to achieve authentication.
To review, see:
5d. Explain digital signatures
- What is a digital signature?
- How do digital signatures help to achieve non-repudiation?
- How are digital signatures implemented?
Even if the sender of a message can be authenticated, the sender can still deny having sent the message. In other words, the message's source can be known, but the sender's actions must still be verified. Digital signatures are a way of achieving non-repudiation. A digital signature is a way of signing a message so that the sender cannot deny sending the message. One common way to achieve this is to use a public key cryptosystem. For example, a sender encrypting with their private key so that the public key can be used for decryption will not achieve confidentiality, but the private key can act as a digital signature because only the sender has the private key. You should be familiar with architectures that achieve non-repudiation.
To review, see:
Unit 5 Vocabulary
This vocabulary list includes terms you will need to know to successfully complete the final exam.
- digital signature
- HMAC
- keyed hash function
- message authentication code (MAC)
- non-repudiation
Unit 6: Key Management
6a. Solve problems involving cyclic groups
- What is a finite group?
- What is a cyclic group?
- What is the order of an element in a cyclic group?
A group is a mathematical concept that is central to many cryptographic systems. By definition, a group is a set G along with some operator that acts on pairs of elements from the G. A group must obey the closure property, must obey the associative property, must have an identity element for the group operator, and every element in the group must have an inverse. A finite group is a group where the set G contains a finite number of elements.
A generator is an element from which all other elements in a group can be generated by successively applying the group operator. A cyclic group is a group that contains a generator. Furthermore, every element in a finite cyclic group has an order which means that it will return to the identity element after successive applications of the group operator. The number of applications of the group operator to return an element to the identity element is called the order of an element. For example, in a congruence modulo p where p is a prime number (a finite cyclic group), a generator will have an order equal to p-1. You should understand generators and the order of an element within a finite cyclic group, such as a congruence modulo p.
To review, see:
6b. Describe the discrete logarithm problem
- What is the discrete logarithm problem (DLP)?
- Why are finite cyclic groups relevant to the DLP?
- Why can cryptographic systems be built upon the DLP?
Given a prime number, p, a congruence modulo p, a generator š¼, and the equation
when the value y is given, the discrete logarithm problem (DLP) determines the value x. A congruence modulo p is a finite cyclic group when p is prime, so the theory of finite cyclic groups is quite relevant to the DLP. Logarithms are exponents, so conceptually, this problem is similar to what you may be used to from basic algebra. The main difference is that the DLP takes place over a congruence modulo p; hence, determining the value of the exponent x can be more challenging. This problem is considered to be computationally difficult to solve and is a good candidate for building cryptographic systems. You should be prepared to compute the value of x via a brute-force search. You should also be prepared to execute Python instructions, such as
alpha **x % p
when the numbers are small. When the numbers are large, you should be prepared to apply the repeated squaring algorithm whose code was developed and applied in previous units.
To review, see:
6c. Apply Diffie-Hellman key exchange
- How can the DLP be applied in cryptographic systems?
- What is Diffie-Hellman (DH) key exchange?
- What information is needed to decrypt the DH key exchange?
Asymmetric cryptography is extremely useful for solving the key distribution problem. The Diffie-Hellman (DH) key exchange protocol is based on the DLP. It allows two parties (for example, Alice and Bob) to exchange information that will lead to computing a key that could be used, for example, in a symmetric cryptographic system.
Diffie-Hellman (DH) key exchange is as follows:
- Given a prime number, p, a congruence modulo p, and generator š¼, Alice chooses a private random integer x from the congruence
- Bob chooses a private random integer y from the congruence.
- Alice sends Bob: YA (where YA = š¼x (mod p) )
- Bob sends Alice: YB (where YB = š¼y (mod p) )
- Alice computes K = (YB)x
- Bob computes K = (YA)y
The value of K is guaranteed to be the same based upon the laws of exponents within a congruence so that Alice and Bob compute the same key. If YA and YB are intercepted, the DLP would have to be solved to compute the secret values of x and y. Once these values are known, they can readily be computed as . Therefore, the security of the DH key exchange is based on the computational security of the DLP. You should be prepared to compute the solution to the DLP for small numbers via a brute force search, and you should be prepared to compute values of YA, YB, and K given a set of values.
To review, see:
6d. Create programs to implement a Diffie-Hellman key exchange
- How is DH key exchange implemented in Python?
- What algorithms in this course would be applicable to the DH protocol?
- How are shared keys computed?
Implementing the DH key exchange requires finding a generator and exponentiation within a congruence. It is assumed at this point that you have code for the repeated squaring algorithm and for finding generators within a congruence. Additionally, you must have code to solve the discrete logarithm problem within a congruence modulo p using a brute force approach (for example, by using a loop). If these tools are in place, then you should be able to compute keys, compute secret values for the exponent, and exponentiate using large numbers. Make sure to practice applying your code with test values to ensure you can compute with values in the DH exchange problems.
To review, see:
Unit 6 Vocabulary
This vocabulary list includes terms you will need to know to successfully complete the final exam.
- cyclic group
- Diffie-Hellman (DH) key exchange
- discrete logarithm problem (DLP)
- finite group
- generator
- order of an element
Unit 7: Elliptic Curve Cryptography
7a. Explain the Weierstrass form of an elliptic curve
- What is the Weierstrass form of an elliptic curve?
- How are congruences modulo p used when applying the Weierstrass form in cryptographic applications?
- What are some mathematical traits of the Weierstrass form of an elliptic curve?
Elliptic curves can be used to form cryptographic systems. One type of elliptic curve that can be understood, given all you know from this course, is the Weierstrass form:
where a and b are parameters that define a specific curve, and p is a prime number. Given a prime value of p, every element in the congruence will have a multiplicative inverse. This property forges a well-posed path to formulating arithmetic operations (such as point addition) on the elliptic curve.
One important point to note about the Weierstrass form is that the same value of x can generate two y values. In an analogy to the square root function for real numbers, both a positive and negative root will satisfy the curve equation. This means that, given some x for which a value y satisfies the equality, then
will also satisfy the equality for the same x. Because of this property, just as with real square root functions, the graph of the Weierstrass form will be symmetric about some y value. You can gain some intuition about the Weierstrass form by choosing a small value of p (such as p=17) along with values of a and b and then plotting some points on the curve.
To review, see:
7b. Solve problems involving elliptic curve groups
- What is point addition
- What is the point at infinity?
- How are these concepts related to forming a group on an elliptic curve?
The starting point for performing algebraic operations on an elliptic curve requires point addition, point doubling, and the point at infinity.
- Point addition involves adding two different points, P and Q, contained on the curve: P+Q.
- Point doubling involves adding a point P to itself: P+P.
- Point at infinity: The result of adding a point P and its mirror image P + (-P) = 0. It is used as the identity element for adding points on an elliptic curve.
You should understand that this set of operations leads to a cyclic group. Furthermore, you should understand how a generator can yield all elements within the group defined on the Weierstrass Curve. To do this, it is important to review the equations for point addition and point doubling and understand how they can be applied within a congruence modulo p.
To review, see:
7c. Write programs to implement ECC
- How is point addition implemented in Python?
- How is point doubling implemented in Python?
- How is a mirror image recognized in Python?
To implement ECC, it will be necessary to implement arithmetic operations on the elliptic curve. This unit focuses on the Weierstrass Curve and the equations associated with this curve. For example, to verify a generator, successive additions must be applied until all elements of the group have been generated. This implies that point addition, point doubling, and the point at infinity must be programmed. A key numerical step in implementing point doubling and point addition requires that multiplicative inverses of elements modulo p must be computed. One way to program this step is to apply the extended Euclidean algorithm.
The point at infinity occurs because a point P has been added to its own inverse (-P), which is the mirror image of P. It should be clear that the equation for point addition will be undefined if used to compute P+(-P). Therefore, the mirror image should be checked before applying the P+Q point addition. Such a condition could be encountered, for example, while using a generator to generate all points within the group. So, to create a suite that can implement arithmetic on an elliptic curve, your code must be prepared to compute P+P, P+Q, and handle the condition P+(-P).
To review, see:
7d. Apply the elliptic curve discrete logarithm problem
- How is scalar multiplication used in the EC discrete logarithm problem (ECDLP)?
- What is the Elliptic Curve Diffie-Hellman (ECDH) protocol?
- How is the DLP problem related to the ECDLP problem?
Given the cyclic group formulation using the addition of points on an elliptic curve, scalar multiplication can be achieved by successive addition. In other words, given a point P, a computation such as 3P can be achieved by computing P+P+P. Given a generator š¼ for this group, the pattern of how group elements will be generated is not known. Assume that , where it takes K "hops" to arrive at the point T on an elliptic curve. If T is given, but K is not, determining K is a computationally difficult problem. In analogy to the DLP, the elliptic curve discrete logarithm problem (ECDLP) refers to determining the value of K (the number of hops).
For the most part, any cryptosystem based upon the DLP can be translated to the ECDLP. One important application of the ECDLP is the Elliptic Curve Diffie-Hellman (ECDH) protocol. Instead of using exponentials, scalar multiplication is used to generate the keys. Alice and Bob still choose secret values x and y, but now Alice forms and Bob forms
. Alice sends Bob YA, and Bob sends Alice YB. Both parties can form the quantity
to achieve the key exchange. For groups containing many points on an elliptic curve, determining x from YA and y from YB is considered computationally difficult. You should be able to generate points on a Weierstrass curve for small values of P. Furthermore, with this code in place, for small values of p, you should be able to determine Alice and Bob's values of x and y if an eavesdropper intercepts YA and YB.
Additionally, given and the generator š¼, you should have code in place to determine K from the value of T using a brute force approach (that is, solve the ECDLP). This framework can also be extended to digital signatures. Elliptic Curve Digital Signature Algorithms (ECDSA) refer to the process where a user's private key from an elliptic curve encryption is used to sign a message.
To review, see:
7e. Contrast the computational security of elliptic curves versus discrete logs
- Why is ECC considered to be secure?
- How does the computational security of RSA compare with ECC?
- How does the computational security of DL compare with ECC?
The security of ECC depends upon the computational difficulty of solving the ECDLP. One theme is consistent across public key systems based upon factoring, the DLP, and the ECDLP. The security of these problems is rooted in the difficulty of determining the sequence of how a generator generates all elements of the group. If this problem can be solved, such cryptosystems would be rendered unusable.
It is important to compare the performance of RSA and systems based on the DLP with systems based on the ECDLP. For example, key exchange systems based on the ECDH are considered to be faster than those based on the DH protocol. It is also generally true that the same amount of security can be achieved with fewer bits when using ECC approaches. From the materials in the course, you should be aware that computational security using fewer bits and computational efficiency are two major reasons why ECC techniques have been adopted.
To review, see:
Unit 7 Vocabulary
This vocabulary list includes terms you will need to know to successfully complete the final exam.
- Elliptic Curve Diffie-Hellman (ECDH)
- Elliptic Curve Digital Signature Algorithms (ECDSA)
- elliptic curve discrete logarithm problem (ECDLP)
- point addition
- point at infinity
- point doubling
- Weierstrass form
Unit 8: Zero Knowledge Proofs
8a. Explain the characteristics of a zero-knowledge proof
- What is soundness?
- What is completeness?
- What is zero knowledge?
A zero-knowledge proof (ZKP) is a cryptographic protocol that provides a means to verify or provide "proof" that one party knows certain information without revealing any further details beyond that fact. Zero-knowledge means that the verifier learns no new knowledge beyond the fact that you do indeed know the information. ZKPs, beyond the zero-knowledge requirement, must have other characteristics to be useful in a practical setting. For example, completeness is a property that means if the statement is true, then an honest verifier (one following the protocol properly) will be convinced of this fact by an honest prover. On the other hand, soundness means that if the statement is false, no cheating prover can convince an honest verifier that it is true (except with some small probability). A zero-knowledge proof must satisfy the three properties: zero-knowledge, completeness, and soundness.
To review, see:
8b. Identify the key features of a SNARK
- What is an Interactive ZKP?
- What is a SNARK?
- What are some zk-SNARKs currently in use?
Zero-knowledge proofs have been motivated by the need for alternative authentication systems where one party wants to prove its identity to a second party via some secret information (such as a password) but does not want the second party to learn anything about this secret. Interactive ZKPs can be probabilistic where many tests need to be performed to build up enough statistics to be confident that the prover has the correct information. Such an approach can be time-consuming and not practical for many applications. Instead, Succinct Non-Interactive Arguments of Knowledge (SNARK) are entities of knowledge that can be proven in one step and do not require further interaction. You should know about current zk-SNARK protocols and how only some are considered post-quantum secure. For example, PLONK is zk-SNARK that is not considered post-quantum secure. In the course materials, there is a table of protocols given along with information about z-SNARK capability and post-quantum security. This table will help you understand the characteristics of many current zk-SNARK protocols.
To review, see:
8c. Describe how ZKPs are applied in practice
How are ZKPs applied in practice?
What is ZoKrates?
What applications are ZKPs being geared toward?
With any new technology, adoption is always an important factor. ZKPs are fun theoretical entities, but the question is who uses them. One of the most important areas on the horizon is decentralized markets such as cryptocurrency and decentralized autonomous organizations. For example, Ethereum blockchain applications are beginning to adopt ZKP protocols. ZoKrates is a platform created for Ethereum to make ZKP implementations more seamless. In this way, its users hope ZKP adoption will become more accessible to the general public. You should be familiar with these applications and what types of problems are being used as proofs for zk-SNARKS.
To review, see:
Unit 8 Vocabulary
This vocabulary list includes terms you will need to know to successfully complete the final exam.
- completeness
- PLONK
- SNARK
- soundness
- zero-knowledge
- zero-knowledge proof (ZKP)
- ZoKrates
Unit 9: Quantum Key Distribution
9a. Explain photon polarization
- What is a photon?
- What is wave polarization?
- What is photon polarization?
It is well-known that light can be described as an electromagnetic field exhibiting wave properties such as interference, refraction, and diffraction. The plane wave description of electromagnetic waves, such as light, allows the amplitude to be polarized along a certain direction. Birefringent materials cause a wave velocity to be dependent upon the direction of propagation. They can be used to control the polarization orientation. The smallest indivisible quantum packet of light is known as a photon implying that light can exhibit both wave-like and particle-like properties depending upon what property is being measured. A photon can be created when an electron orbiting an atomic nucleus drops from a higher energy level to a lower energy. The difference in energy between the two levels dictates the frequency of the electromagnetic radiation given off by the energy level transition. Finally, since waves can be polarized, so can photons. Photon polarization means that photons possess a polarization orientation. When the intensity of a light beam is reduced to a single photon, it retains the properties of the original wave. You should be familiar with wave-like and particle-like properties of photons as they are central to quantum communications concepts.
To review, see:
9b. Describe the security of quantum communications
- What are some relevant properties of quantum objects?
- How can photons be used in quantum communications?
- What is the Heisenberg uncertainty principle?
The Heisenberg uncertainty principle, which states that we cannot know both the position and speed of a particle, such as a photon or an electron, with perfect accuracy, places limits as to when the simultaneous measurement of observable quantities can take place. For example, in contrast to a classical object such as a baseball, it is impossible to simultaneously measure the position and the momentum of a quantum object such as an electron. The implication is that a measurement of a quantum system cannot take place without affecting the system. This principle lies at the heart of quantum communications since it can be known if an eavesdropper is listening on the channel.
Another important principle is that of probabilistic quantum measurement, where measurement outcomes of a quantum system are inherently probabilistic. Recall that a beam splitter is a material that can separate light waves into two beams, one that is horizontally polarized and one that is vertically polarized. If a single photon polarized at 45 degrees encounters the beam splitter, since the photon is indivisible, it will randomly choose one of the two paths. This means there is a 50-50 chance of the photon emerging from the beam splitter as either horizontally or vertically polarized. You should be aware that quantum measurements can affect the measurement statistics in a way that can reveal the presence of an eavesdropper. This fact is also relevant to quantum communications and especially for developing protocols for quantum key distribution (QKD), the process of applying the quantum properties of photons to distribute keys between two parties.
To review, see:
9c. Identify features of the BB84 protocol
- What is the BB84 protocol?
- How is QKD performed using the BB84 protocol?
- What key quantum principles are used in the BB84 protocol?
The BB84 protocol is one of the earliest approaches to performing QKD using photon polarization. The quantum principles most central to this protocol are probabilistic quantum measurement and the Heisenberg uncertainty principle. You should be familiar with "bra-ket" notation for describing photon states. For example, |0> or |H> could represent a horizontally polarized photon. In the BB84 protocol, a photon state can be written as
cos š|0> + sin š|1>
where š is the polarization angle.
Using the BB84 protocol, Alice and Bob can create a shared key, which is as follows:
- Alice sends Bob a string of single photons whose polarization is randomly chosen from the set {H,V,45, 135}. The sequence of these polarizations is kept secret.
- Bob makes a measurement of each photon using either an H-V polarizer or a 45-135 polarizer, records the result of the measurement, and keeps these measurements secret.
- Bob publicly announces the type of measurement (H-V or 45-135) made on each photon.
- For each photon, Alice tells Bob which measurement type aligned with the original photon sent.
- Bob and Alice keep the measurements that were aligned and create a binary sequence for the key based upon the measurement (for example, H ā 0, Vā1, 45ā0, 135ā1).
An eavesdropper with measurable probability can be detected because the expected ratio of aligned measurements to misaligned measurements would be altered. If an eavesdropper is detected, then throw out the key.
To review, see:
9d. Describe the current state of QKD
- What quantum principles beyond those of BB84 can be applied to QKD?
- What are some other protocols that have been proposed?
- Why have these protocols been developed?
Probabilistic measurement and the Heisenberg uncertainty principle are central to secure quantum communications and QKD. Another useful concept is entanglement, where two photons exist in a state where one can always affect the other. For example, assume one photon is in an H state and the other is in a V state. If the states are entangled, this means that, no matter how far apart the photons are, an H measurement of one directly implies a V measurement of the other and vice versa. The E91 (Eckert91) protocol is an approach to QKD that directly applies entangled photons as part of the key verification process between sender and receiver. It is considered to be more robust than the BB84 approach. The COW (Coherent One-Way) protocol is an approach to QKD that applies entanglement so that a receiver does not need to settle photon statistics with the sender. The name one-way implies that the receiver can perform a security check based solely on entanglement statistics. These entanglement protocols were developed to address the security shortcomings of BB84. More sophisticated protocols are on the horizon as this field develops from its embryonic state.
To review, see:
Unit 9 Vocabulary
This vocabulary list includes terms you will need to know to successfully complete the final exam.
- BB84
- beam splitter
- birefringent
- COW
- E91
- entanglement
- Heisenberg uncertainty principle
- photon polarization
- probabilistic quantum measurement
- quantum key distribution (QKD)
Unit 10: Quantum Algorithms
10a. Explain quantum operators
- What is superposition?
- What is entanglement?
- What are some properties of quantum operators?
A state vector for a quantum computational system is defined as a vector that contains all the information necessary for performing quantum computations. For example, a single qubit state vector is of the form
|š> = a|0> + b|1>
where . A linear superposition is a linear combination of a set of basis states. In the above single qubit example, the state vector |š> is said to be in a linear superposition of the computational basis kets
and
. The probability of measuring a system in state
is
, and the probability of measuring a system in state
. The state vector for a two-qubit system, in general, has the form
|š> = a00|00> + a01|01>+ a10|10>+ a11|11>
where the sum of the amplitude magnitudes squared is now normalized to a value of 1. Higher qubit systems can be built up from tensor products of lower qubit systems; however, it is not always the case that a higher qubit system can be expressed in terms of lower qubit systems. Consider a two-qubit system that looks like
|š> = a00|00> + a11|11>
This system is known as an entangled system and cannot be built up from a tensor product of single qubit states. You should understand the concepts of superposition and entanglement in quantum systems.
Quantum operators are those that operate on state vectors that define a quantum state. Quantum computation applies a set of quantum operators to a state vector to achieve a specific computation. In quantum computation, operators are usually expressed as a matrix that operates on state vectors. Typical operators applied in quantum computation are the Hadamard matrix, Pauli spin matrices, rotation gates, Fourier operators, permutation matrices, Toffoli gates, and CNOT gates. Quantum computation must be reversible, and this constraint implies that all quantum operators must be unitary (that is, the Hermitian adjoint must be equal to the matrix inverse). While this is not a course in quantum computation, you should be familiar with basic concepts involving reversible computation, unitary matrices, and quantum operators.
To review, see:
10b. Apply the order-finding problem to factoring
- What is the order-finding problem?
- How is factoring related to order finding?
- Why is order finding important to cryptography?
Nontrivial roots of unity are defined as nontrivial solutions to the equation
s2=1 mod N
The rearrangement of this equation as
(s+1)(s-1)=s2-1 = 0 mod N
is a path to factoring the composite number N. If the gcd(q,N)=1 for some q in the congruence modulo N, then some m is guaranteed to satisfy
qm = 1 mod N
where m is the order of q. The order-finding problem is defined as the process of finding m such that
qm = 1 mod N.
Therefore, finding nontrivial roots of unity to factor N can be translated into the order-finding problem. Since there is currently no known method to predict the successive powers of q, determining the value of m is considered computationally difficult as N becomes large. Since RSA depends upon factoring a composite number N, solving the order-finding problem is directly relevant to cryptography. At this point in the course, you should have code available to compute the order of an element q by computing successive powers (which may involve either successively computing q**m or using your repeated squaring algorithm).
To review, see:
10c. Explain Shor's algorithm
- What is Shor's algorithm?
- How is order finding related to Shor's algorithm?
- What are some quantum operators used in Shor's algorithm?
There is no known classical factoring algorithm that is computationally efficient. This is why systems such as RSA have been considered to be computationally secure. Shor's algorithm is a quantum-based scheme that is efficient for factoring numbers and solving the discrete logarithm problem. Understanding that some parts of Shor's algorithm can be solved efficiently via classical means is important. For example, verifying that the gcd(q,N)=1 for some value q in the congruence modulo N can readily be performed using the Euclidean algorithm. Shor's algorithm turns the order-finding problem into a period-finding problem and creates quantum operators that can successively exponentiate. The architecture for Shor's approach to solving the order-finding problem involves Hadamard operators, exponentiation operators, and an inverse Fourier operator. The inverse Fourier operator is applied to perform what is known as phase estimation. While this is not a course in quantum computation, you should be familiar with the concepts necessary for understanding how Shor's algorithm works and why it can be used to solve the factoring problem.
To review, see:
Unit 10 Vocabulary
This vocabulary list includes terms you will need to know to successfully complete the final exam.
- linear superposition
- nontrivial roots of unity
- order-finding problem
- quantum computation
- quantum operator
- Shor's algorithm
- state vector