************* Caesar Cipher ************* .. tags:: short, beginner, cryptography, math The Caesar cipher is an ancient encryption algorithm used by Julius Caesar. It encrypts letters by shifting them over by a certain number of places in the alphabet. We call the length of shift the key. For example, if the key is 3, then A becomes D, B becomes E, C becomes F, and so on. To decrypt the message, you must shift the encrypted letters in the opposite direction. This program lets the user encrypt and decrypt messages according to this algorithm. In modern times, the Caesar cipher isn’t very sophisticated, but that makes it ideal for beginners. The program in Project 7, “Caesar Hacker,” can brute-force through all 26 possible keys to decrypt messages, even if you don’t know the original key. Also, if you encrypt the message with the key 13, the Caesar cipher becomes identical to Project 61, “ROT 13 Cipher.” Learn more about the Caesar cipher at https://en.wikipedia.org/wiki/Caesar_cipher .. collapse:: caesar_cipher.py .. literalinclude:: caesar_cipher.py :language: python :linenos: https://inventwithpython.com/bigbookpython/project6.html