A Mafia boss was caught partly by a code Julius Caesar used
In April 2006 police in Sicily captured the fugitive Mafia boss Bernardo Provenzano, helped by the fact that some of his notes were written in a clumsy variant of the Caesar cipher, where A became 4 and B became 5. The trick was two thousand years old and trivially easy to break.
The method is about as simple as encryption gets. Each letter is swapped for one a fixed number of places along the alphabet. According to the Roman historian Suetonius, Julius Caesar protected military messages with a shift of three, so A became D, while his nephew Augustus shifted by one and, instead of wrapping around, wrote Z as AA. Turn letters into numbers from 0 to 25 and the whole scheme is just addition that wraps around at 26. One quirk trips up programmers: finding the remainder of a negative number gives 3 in Python but minus 2 in JavaScript.
How well it worked in Rome is unknown, since no record survives of anyone cracking such ciphers then. The earliest known technique for doing so, frequency analysis, appears in the ninth-century writings of Al-Kindi. Breaking it today needs no cleverness at all. English allows only 25 shifts, so an attacker can try every one and see which produces sense; the scrambled string exxegoexsrgi, shifted by four, becomes attackatonce. On average about two letters are enough to pin down the key, and six almost always suffice. Encrypting twice adds nothing, because two shifts equal one bigger shift.
Even so, it kept turning up. Victorian lovers traded Caesar-shifted notes in the personal columns of The Times. In 1915 the Russian army adopted it because its troops struggled with harder codes, and German and Austrian codebreakers read the messages easily.
The shift also lives on inside stronger systems. The Vigenere cipher applies a different Caesar shift at each letter according to a keyword, and ROT13, a shift of thirteen, still hides joke punchlines and spoilers online. Secret decoder rings in toy boxes run on the same principle.
Source: Caesar cipher