diff options
Diffstat (limited to 'assignments/3-solution.md')
| -rw-r--r-- | assignments/3-solution.md | 26 |
1 files changed, 16 insertions, 10 deletions
diff --git a/assignments/3-solution.md b/assignments/3-solution.md index 478de5a..3403327 100644 --- a/assignments/3-solution.md +++ b/assignments/3-solution.md @@ -109,17 +109,23 @@ Chapter 8: > 9. Using a Caesar cipher with s = 5, decode the received message RTAJ TZY FY IF -```plaintext -| A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z | - -Key: s = 5 - -| F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z | A | B | C | D | E | - -| Ciphertext | RTAJ TZY FY IFBS | -| Plaintext | MOVE OUT AT DAWN | -``` +The following code can be used to decipher the Caesar cipher. ```ruby !include assignments/3/caesar.rb ``` + +The plaintext is `MOVE OUT AT DAWN`. + +```bash +$ ruby caesar.rb +# Caesar Cipher + +| --------------- | --------------------------------------------------- | +| Plain Alphabet | A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z | +| Cipher Alphabet | F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,A,B,C,D,E | +| --------------- | --------------------------------------------------- | +| Key | 5 | +| Ciphertext | RTAJ TZY FY IFBS | +| Plaintext | MOVE OUT AT DAWN | +``` |
