Caesar Cipher Algorithm in Python

Example of Caesar Cipher in Python

Image on Wikipedia

Caesar Cipher is the most popular encryption technique where each letter in the original text is replaced by a letter according to the shifted alphabet. For example, with a left shift of 3, D would be replaced by A, E would become B, and so on.

Let’s say that we shift the alphabet by 3 positions on the left. Then we get:



Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
George Pipis

George Pipis


Sr. Director, Data Scientist @ Persado | Co-founder of the Data Science blog: