//*********************************************************************** // vigenere.cpp // // this is an implementation of the vigenere polyalphabetic cipher // using the vigenere object class // // it encrypts plaintext and decrypts ciphertext // // INPUTS: (from disk file) // encryption: key, plaintext // // decryption: key, ciphertext // // OUTPUTS: (to disk file) // encryption: ciphertext // // decryption: plaintext // // (to the screen) // main interaction menu // //*********************************************************************** // WARNING: // this program requires 4 disk files on the A drive: key.txt, // plaintext_in.txt, plaintext_out.txt. and ciphertext.txt // //*********************************************************************** // IMPLEMENTATION NOTE: // this program compiles with 4 instances of compiler warning C4786 // when compiled in DEBUG mode // // these warnings DO NOT affect the program - ignore them // //*********************************************************************** // created by: j. aleshunas // created on: 8 may 02 // modified on: 19 jun 02 // //*********************************************************************** #include "vigenere.h" void main(void) { // the cipher instance for this session Vigenere_cipher vcclCipher_instance; // the bNot_finished flag controls the main menu loop bool bNot_finished = true; // the menu selection int iMenu_selection; // start a while loop toggled by the bNot_finished flag while(bNot_finished) { // infinite loop cout << endl; cout << " What do you want to do?" << endl; cout << endl; cout << " 1. Encrypt a message" << endl; cout << " 2. Decrypt a message" << endl; cout << " 3. Quit" << endl; cout << endl; cout << " Enter your selection --> "; cin >> iMenu_selection; cout << endl; // actions for each menu selection switch(iMenu_selection) { case 1: // encrypt the plaintext vcclCipher_instance.Encryption(); break; case 2: // decrypt the ciphertext vcclCipher_instance.Decryption(); break; case 3: // set the loop flag to quit looping bNot_finished = false; break; default: // display and error message for invalid menu selections cout << endl; cout << iMenu_selection << " is not a vaild menu selection"; cout << endl; cout << "Please make a valid choice"; cout << endl << endl; }// switch }// while return; // that's all folks }// main()