HelpContactFor teachers and institutes
>_StemPy Lab
Mock TestsClasses

>_StemPy Lab

Learn. Solve. Code the solutions. Test yourself.

Live examsFree mock exams, timed and rankedEveryone starts together, and your score and rank come the moment it ends.See the exams →

Learn

  • Physics
  • Chemistry
  • Mathematics
  • Biology
  • Python Programming
  • Statistics & Data Science
  • Computer Science
  • Classes
  • Groups

Practice

  • Problems
  • Quizzes
  • Mock Tests
  • Prepare for an Exam
  • Question Sets
  • Exams
  • Certificates
  • Python Labs
  • AI Practice Generator
  • Student-Created Tests

Community

  • Discussions
  • Resources
  • Notes
  • Glossary
  • Blog

Account

  • Log in
© 2026 senLearn. All rights reserved.HelpFor SchoolsAboutContactPrivacy PolicyTerms of UseRefund Policy
  1. Problems
  2. /An attacker learns that, with a certain shift cipher key, the letter S was encrypted as B…
HardComputer ScienceHigh School (9–10)Computer Science › Encryption and Cyber SecurityNumericalConceptualIGCSE

An attacker learns that, with a certain shift cipher key, the letter S was encrypted as B…

StemPy LabContributed by StemPy Lab

Try it on paper first. A hint, the key idea and the worked solution are here when you need them.

An attacker learns that, with a certain shift cipher key, the letter S was encrypted as B. Later he intercepts the ciphertext UXLT, made with the same key. Number the letters A =0= 0=0 to Z =25= 25=25.

  1. What is the key?
  1. What is the number of the first plaintext letter of UXLT?
  1. Explain what this shows about keeping a key secret.

Check your answer

Work it out on paper, then type your number. The answer itself stays hidden.

Need a reminder? The key ideaShowHide

Data can be intercepted on a network. Encryption turns plaintext into ciphertext with an algorithm and a key, so intercepted data is meaningless without the key; it does not stop interception. In a shift cipher, with A =0= 0=0 to Z =25= 25=25, the rule is c=(p+k) mod 26c = (p + k) \bmod 26c=(p+k)mod26.

The worked solution

Have you tried it?

Work it out on paper first. It is fine to get stuck or make a mistake: that is how we learn. When you are ready, go through the solution one step at a time, and check each step against your own.

Step 1. The key. S =18= 18=18 and B =1= 1=1. We need (18+k) mod 26=1(18 + k) \bmod 26 = 1(18+k)mod26=1. Going past Z means the total is 26+1=2726 + 1 = 2726+1=27, so 18+k=2718 + k = 2718+k=27 and k=9k = 9k=9. Check: 18+9=2718 + 9 = 2718+9=27, and 27−26=127 - 26 = 127−26=1, which is B.

Step 2. Decrypt the first letter. U =20= 20=20, and 20−9=1120 - 9 = 1120−9=11, which is L.

Step 3. The rest. X =23= 23=23 gives 141414, O. L =11= 11=11 gives 222, C. T =19= 19=19 gives 101010, K. The plaintext is LOCK.

Step 4. What it shows. Once the key is known, every message made with it can be read. The whole safety of encryption rests on the key staying secret.

Answer: (a) 999. (b) 111111, the letter L. (c) Anyone who learns the key can decrypt all the data.

Log in to save this for later
← All Problems
← Kwame intercepts a message made with a shift cipher…A symmetric encryption system uses keys made of bits… →
More onComputer Science › Encryption and Cyber Security

Discussion (0)

Log in to join the discussion.

Loading…

More on this topic

  1. A teacher wants each of her 30 students to be able to send her a private message that no other…Hard
  2. This is a toy model with tiny numbers. The exam does not ask for this calculation…Medium
  3. A company has 12 staff, and each has an asymmetric key pair…Easy
  4. A class of 20 students wants every student to be able to send a private message to every other…Hard
  5. Five members of a project team each want to send private messages to every other member, using…Medium
All problems on this topic →