Prepare for the AP Computer Science Exam. Study with flashcards and multiple-choice questions. Each question comes with detailed explanations and hints. Excel in your exam!

Each practice test/flash card set has 50 randomly selected questions from a bank of over 500. You'll get a new set of questions each time!

Practice this question and more.


What is the defining characteristic of a substitution cipher?

  1. All letters remain in their original position

  2. Letters are replaced based on a fixed number of shifts

  3. It does not require a key

  4. Only numbers are encrypted

The correct answer is: Letters are replaced based on a fixed number of shifts

A substitution cipher is defined by the principle that each letter in the plaintext is replaced with another letter, digit, or symbol to create the ciphertext. This substitution can vary from one letter to another, but the specific characteristic that distinguishes substitution ciphers is that letters are replaced based on a fixed system of mapping, which can sometimes involve a defined number of shifts—like in the Caesar cipher, where each letter is shifted by a consistent number in the alphabet. While other options touch on different aspects of cryptography, they do not reflect the core nature of substitution ciphers accurately. For instance, letters do not remain in their original position, as the defining feature of these ciphers involves rearranging or replacing them. The use of a key is typically integral to ensuring that the correct letter substitutions are made, which rules out the option of not requiring a key. Lastly, substitution ciphers encompass the replacement of letters, and while they could also involve numbers, stating that only numbers are encrypted does not accurately describe the general behavior of substitution ciphers.