Caesar Cipher

download Caesar Cipher

If you can't read please download the document

description

Caesar Cipher

Transcript of Caesar Cipher

DAVID DICIURCIO: So let's talk a little bit about cryptography. Cryptography is the science of encoding and decoding information. The practice has been used for centuries, from sending secret messages to military generals or keeping your password safe when you log into Facebook or Google. One form of encryption, or the encoding of information, is Caesar cipher, named after Julius Caesar. Caesar cipher works by taking a series of letters and substituting every letter with another letter a fixed number of positions down the alphabet. When the cipher reaches the letter Z, a key of one will loop the plain text back to A. So let's start with some simple examples. Let's say, the letter A, and we're working with a key of one. The A will shift to a B. Let's say our key is three. Then we end up having our A shift three positions down the alphabet to the letter D. So let's say we start with the word cat, and we're working with a key of five. The C ends up shifting to an H, the A ends up shifting to an F, and the T becomes a Y. And this is our encryption, hfy. Now let's try a slightly more difficult example, something that requires Z to A looping. Let's say we're given the word computer and we're working with a key of seven. We look at the first letter, a C, and we shift it down seven positions in the alphabet to the letter J. We do the same with the O, and it goes to a V. And then P follows suit with T and W. Now, U is our first special case in our encryption. It requires Z to A looping. That's just a way of saying that once we reach letter Z, we go back to the letter A. So U ends up going to the letter B, and T ends up going to the letter A. And R, finish it up, and here we are with our encryption, jvtwbaly. To shift back to our original text, we only need to shift our cipher text 26 minus 7 positions, or 19 positions, and we're back at the beginning. Unfortunately, Caesar cipher is not the most secure form of encryption as exemplified by its simplicity. There are only 26 possible shifts, 0 through 25, of which one will decrypt the cipher text back to its original plain text. It'd be relatively easy for a human, let alone machine, to decrypt text ciphered with Caesar shift. Caesar shift is but one method of encryption, and if often incorporated as a step in more complex ciphers such as Vigenere cipher. But more on that at another time. Well, that's all, and thanks for watching.