Prepare for the AP Computer Science Exam with our comprehensive quiz. Use our flashcards and multiple-choice questions to test your knowledge and uncover valuable hints. Get exam-ready today!

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.


In which type of cipher is each letter replaced with a letter a certain number of places down the alphabet?

  1. Vigenère cipher

  2. Caesar cipher

  3. Transposition cipher

  4. Substitution cipher

The correct answer is: Caesar cipher

The Caesar cipher specifically involves replacing each letter of the plaintext with another letter that is a fixed number of positions down the alphabet. For example, with a shift of 3, the letter 'A' would be replaced by 'D', 'B' would become 'E', and so on. This simple method of encoding is straightforward and historically significant, often introduced as an early example of encryption in educational contexts. In contrast, the Vigenère cipher utilizes a more complex method, involving a keyword to determine the shift for each letter, making it more secure than the Caesar cipher. The transposition cipher does not alter the letters themselves but rearranges their positions, thus maintaining the original letters' identities while changing their order. Substitution ciphers, while they may sound similar, generally refer to any cipher where each letter is replaced with another letter or symbol without defining a fixed shift, thereby including a variety of methods beyond just the Caesar cipher. Therefore, the defining characteristic of the Caesar cipher aligns perfectly with the description given in the question, making it the correct answer.