After a Caesar cipher review, we'll have an example of how to solve it and then your challenge. Remember how the Caesar cipher works. You have an alphabet of available characters, you take in the message and a shift
value, and then you just shift the characters forward that many steps in the alphabet, wrapping around if you go around the end. The script we end up with works for any shift
value, including normal numbers, such as 3
, or even numbers that are larger than 26
; they just wrap around and can scramble any data you put it.
Here's an example:
- For ciphertext, you can decipher it by just trying all the
shift
values from0
to25
, and one of them will just be readable. This is a simple brute-force attack. Let's take a look at it.
Here, in Python, go to the caesar4
script, that we had before. It takes in a string and shifts it by any value you specify. If we use that script, we can run it as follows:
- Then, if we put in
HELLO
and shift it by3
, it turns intoKHOOR
. - If we want to crack it, we can use the solution script as follows:
- So, if we use that script, we can run it:
- Your challenge is to decipher this string:
MYXQBKDEVKDSYXC
.
In the next section, we'll have a challenge on base64
.