Case study
Let's walk through test-driven development by writing a small, tested, cryptography application. Don't worry–you won't need to understand the mathematics behind complicated modern encryption algorithms such as AES or RSA. Instead, we'll be implementing a sixteenth-century algorithm known as the Vigenère cipher. The application simply needs to be able to encode and decode a message, given an encoding keyword, using this cipher.
Note
If you want a deep dive into how the RSA algorithm works, I wrote one on my blog at https://dusty.phillips.codes/.
First, we need to understand how the cipher works if we apply it manually (without a computer). We start with a table like the following one:
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
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 A
C D E F G H I J K L M N O P Q R S T U V W X Y Z A B
D E F G H I J K L M N O P Q R S T U V W X Y Z A B C
E 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
F G H I J K L M N O P Q R S T U V W X...