Encryption and Ciphers

Encryption is the process of transforming readable information, called plaintext, into an encoded form, called ciphertext. The opposite process, transforming ciphertext back into plaintext, is called decryption. Encryption protects data from unauthorized readers while it is transmitted or stored, for example when sending text messages and emails, making online purchases, or storing personal information on a computer.

An algorithm that performs encryption, turning plaintext into ciphertext, is called a cipher. The algorithmic processes of a cipher should depend on one or more keys, additional information that controls how a cipher operates. The necessary secret keys are kept by or shared only with authorized parties, so a well-designed modern cipher cannot be efficiently decrypted without them.

In this lab, we introduce a simple cipher based on modular arithmetic. Real-world encryption methods are far more complicated and secure. A simple cipher may make a message difficult to read at a glance, but it does not provide meaningful security. Can you tell, by inspection alone, what the plaintext of the following ciphertext is?

LW ZDV WKH EHVW RI WLPHV, LW ZDV WKH ZRUVW RI WLPHV,
LW ZDV WKH DJH RI ZLVGRP, LW ZDV WKH DJH RI IRROLVKQHVV,
LW ZDV WKH HSRFK RI EHOLHI, LW ZDV WKH HSRFK RI LQFUHGXOLWB,
LW ZDV WKH VHDVRQ RI OLJKW, LW ZDV WKH VHDVRQ RI GDUNQHVV,
LW ZDV WKH VSULQJ RI KRSH, LW ZDV WKH ZLQWHU RI GHVSDLU,
ZH KDG HYHUBWKLQJ EHIRUH XV, ZH KDG QRWKLQJ EHIRUH XV,
ZH ZHUH DOO JRLQJ GLUHFW WR KHDYHQ, ZH ZHUH DOO JRLQJ GLUHFW WKH RWKHU ZDB -
LQ VKRUW, WKH SHULRG ZDV VR IDU OLNH WKH SUHVHQW SHULRG, WKDW VRPH RI LWV
QRLVLHVW DXWKRULWLHV LQVLVWHG RQ LWV EHLQJ UHFHLYHG, IRU JRRG RU IRU HYLO,
LQ WKH VXSHUODWLYH GHJUHH RI FRPSDULVRQ RQOB.

This one is a little harder.

XSEGMK LWDWYJSEK
SJJANWV KSXWDQ. ZSNW TWWF KZGL. VGULGJ KSQK FGL VSFYWJGMK.
NWJQ KGJJQ USFFGL UGEW. DAW XGDDGOK TQ HGKL.
KLJWWLK XDGGVWV. HDWSKW SVNAKW. (KWFL XJGE NWFAUW)

To convert between plaintext and ciphertext, we first need a few tools for working with text in general.