O'Reilly logo

Get Programming with Go by Nathan Youngman and Roger Peppé

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Lesson 11. Capstone: The Vigenère cipher

The Vigenère cipher (see en.wikipedia.org/wiki/Vigenere_cipher) is a 16th century variant of the Caesar cipher. For this challenge, you will write a program to decipher text using a keyword.

Before describing the Vigenère cipher, allow us to reframe the Caesar cipher, which you’ve already worked with. With the Caesar cipher, a plain text message is ciphered by shifting each letter ahead by three. The direction is reversed to decipher the resulting message.

Assign each English letter a numeric value, where A = 0, B = 1, all the way to Z = 25. With this in mind, a shift by 3 can be represented by the letter D (D = 3).

To decipher the text in table 11.1, start with the letter L and shift it by D. Because ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required