“The Caesar Cipher (Caesar Shift, Caesar’s Code) is a simple, easy to implement substitution cipher. The cipher is named after Julius Caesar. The cipher works by taking the letters of the message and then shifts the letter a defined space along the alphabet.
For example a shift of 1 character would make a=b, b=c, c=d etc.”
I have looked at creating a few ways to use the Caesar Cipher, however I’ve never included a brute force method which is something I am going to correct now.

—
—
The Python program takes an encrypted string and then outputs all possibilities of the string by cycling through each possible Caesar Cipher. For small strings this is quite quick, however for larger strings it will take longer. Possible future improvements would be outputting all possibilities to different text files, and/or using character frequency to pick out the possible vowels.
This blog post was inspired by the Future Learn course, “Introduction to Encryption and Cryptography” which I am currently undertaking. The GitHub for my Caesar Cipher Python files is available at: https://github.com/geektechdude/Python_Caesar_Cipher
My previous posts on the Caesar Cipher can be found at:
Python:
https://geektechstuff.com/2018/02/25/caesar-cipher-python/
Python (with a graphical user interface):
https://geektechstuff.com/2018/12/10/caesar-cipher-with-gui-python/
Java:




3 responses to “Brute Force Caesar Cipher (Python)”
[…] / ideas of Giovan Battista Bellaso. Previously I have looked at the Caesar cipher and included a Python program that can brute force crack the cipher. The Caesar cipher can be easily broken either via frequency analysis of letters […]
LikeLike
[…] few weeks I have been looking at ciphers and encryption, which has included a Python program to brute force the Caesar cipher, Python to encrypt / decrypt with the Vigenère cipher , some Morse code and RSA Public […]
LikeLike
[…] a month ago I used Python to brute force the Caesar Cipher (I blogged about it here: https://geektechstuff.com/2019/12/22/brute-force-caesar-cipher-python/). My original solution outputted a solution for each possible cipher shift, which worked ok for […]
LikeLike