Encrytpion exercise (Problem Set 5) from EdX 6.00x 'Intro to Computer Science and Programming' course