Ceasar Cipher
The Caesar cipher is one of the simplest and oldest known encryption techniques. It works by shifting each letter in the plaintext a fixed number of positions down the alphabet. Here's how it operates: Choose a shift value (often called the "key"), typically a number between 1 and 25. For each letter in your message, move that many steps forward in the alphabet, wrapping around to the beginning if you pass Z. For example, with a shift of 3, A becomes D, B becomes E, and so on, while X becomes A, Y becomes B, and Z becomes C. Numbers and special characters usually remain unchanged. To decrypt, simply shift each letter back by the same number of positions. The cipher is named after Julius Caesar, who allegedly used it with a shift of 3 to protect military messages. While easy to use and understand, the Caesar cipher is also extremely weak by modern standards. It can be easily broken by trying all 25 possible shifts or by frequency analysis of the ciphertext. Despite its simplicity, the Caesar cipher serves as a fundamental introduction to the concepts of encryption and forms the basis for more complex ciphers.
Time Complexity
Best CaseO(n)
Average CaseO(n)
Worst CaseO(n)
Implementation
Encryption
Encrypt your message using the Caesar cipher