Try This: More Combinations
Just as a PIN is stronger with an increased number of combinations, so is the cipher. The ascii_shift cipher has more combinations.
- Duplicate radio_send_images_caesar_key_unknown as radio_send_images_caesar_key_unknown_try_this.
- Duplicate radio_receive_images_caesar_brute_force as radio_receive_images_caesar_brute_force_try_this.
- Replace the caesar functions in both programs with the ascii_shift function from the Cybersecurity: Encryption Intro tutorial’s ASCII Shift Cipher activity.
- Replace the call caesar(key, packet) blocks from both programs with call ascii_shift(key, packet) blocks.
- In radio_send_images_caesar_key_unknown_try_this, change set key to (pick random (1 to 25)) to set key to (pick random (1 to 93)).
To crack the cipher, your project will have to examine more combinations.
- In radio_receive_images_caesar_brute_force_try_this, change for key in (range start(-1) end (-26) step (-1)) to for key in (range start(-1) end (-94) step (-1)).
You might notice an upper-case HAPPY as well as a lower-case happy. The key that generates the upper-case HAPPY is the correct answer, though either might actually work for a sniffing attacker’s purposes. This is an additional weakness of the ASCII Shift cipher. Make sure not to choose a key that will simply encrypt your upper-case characters as lower-case or vice-versa.