Posts

Showing posts from August, 2021

Vigenère cipher encryption with C++

Image
Vigenère cipher is a substitution cipher that uses a 26 x 26 alphabetic table to either encrypt or decrypt. For example, say we wanted to encrypt the plaintext: "DAY" Then we would first pick an arbitrary keyword for the letter, let's go with: "SEE" From there on out, we would use the plaintext on the columns and keyword on the rows on the 26 x 26 table and then substitute. Ultimately, we would see that the plaintext combined with the keyword turns into: "VEC" Which will be our final encrypted text. An illustration of this can be seen visually as: Now, let's move over to the C++ program and start with main.cpp. main.cpp #include "Vigenere.h" Vigenere * vigenere = nullptr; int main () { vigenere = new Vigenere(); while (vigenere -> isRunning()) { vigenere -> showMenu(); vigenere -> handleEvents(); } return 0 ; } In this case, we're simply creating a new instance of a Vigenere object that we're g