From c6fcbf5a8f05c60f05868f43b837473373a8b3d7 Mon Sep 17 00:00:00 2001 From: Kristyn Bryan Date: Wed, 22 Jun 2016 21:29:00 -0400 Subject: [PATCH] Update README.md --- unit_02/w06d04/morning_exercise/README.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/unit_02/w06d04/morning_exercise/README.md b/unit_02/w06d04/morning_exercise/README.md index e69de29..0b55f23 100644 --- a/unit_02/w06d04/morning_exercise/README.md +++ b/unit_02/w06d04/morning_exercise/README.md @@ -0,0 +1,16 @@ +## The Caesar Cipher + +From Wikipedia: + +> In cryptography, a Caesar cipher is one of the simplest and most widely known encryption techniques. It is a type of substitution cipher in which each letter in the plaintext is replaced by a letter some fixed number of positions down the alphabet. The method is named after Julius Caesar, who used it in his private correspondence. + +We're going to implement a simple Caesar Cipher called ROT13 ("rotate by 13 places"). The transformation can be represented by aligning two alphabets, like so: + +``` +Plain: abcdefghijklmnopqrstuvwxyz +Cipher: nopqrstuvwxyzabcdefghijklm +``` + +ROT13 is its own inverse; that is, to undo ROT13, the same algorithm is applied, so the same action can be used for encoding and decoding. The algorithm provides virtually no cryptographic security, and is often cited as a canonical example of weak encryption. ROT13 is used in online forums as a means of hiding spoilers, punchlines, and puzzle solutions from the casual glance. + +Write a method that will take a string as an input and encode / decode it using ROT13.