Rockefeller Laboratory of Statistical Genetics

Simple Cypher

Create a program which uses a simple substitution algorithm to encrypt and decrypt text.

To encrypt the text we will shift each letter in the text a certain number of letters up through the alphabet. The number of letters to shift will be the key.

Example using key=3:

  • A => D
  • B => E
  • ...
  • Y => B
  • Z => C
  • "shift each letter three" => "vkliw hdfk ohwwhu wkuhh"

Write a program which will read in a text message and encrypt or decrypt it based on a given key

As extra practice, try to determine a way to "crack" a decrypted message by determining what key produced it. For this a list of valid words will be useful, you can download one here


Last Update: Tue May 27 12:05:02 2003