

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Programming code in C++ to solve tokenization of vigenere with pointers merging information into an encryption and decryption paragraph.
Typology: Assignments
1 / 2
This page cannot be seen from the preview
Don't miss anything!


/Tokenization assignment--use of pointers, passing into functions, using them as return data types, and leveraging them in traversig arrays. CSIS 112
msg.makeFile(filename); cout << "\n\nEncrypted file:\n"; msg.showWords(); } } else if (opt == 2) { cout << "\nEnter the name of the file to decrypt: "; getline(cin, filename); ifstream in("Invictus"); if (!in) { cout << "File not found!!!\n"; } else { while (!in.eof()) { in.getline(buff, 1000); const char* delim = " "; char* next_token; token = strtok_s(buff, delim, &next_token); while (token) { msg.decryptWord(token); token = strtok_s(NULL, delim, &next_token); } } in.close(); cout << "\nA new file will be created that contains the decrypted message.\n\n"; cout << "Enter the name of the new file to create: "; getline(cin, filename); msg.makeFile(filename); cout << "\n\nDecrypted file:\n"; msg.showWords(); } } cout << endl; opt = displayMenu(); } cout << "\n\nThank You!!\n"; return 0; 6; } //Implementation of menu unction int displayMenu() { int opt; cout << "\tVigenre Cypher\n\n Main Menu\n\n1 - Encrypt File\n2 - Decrypt File\n3 - Quit\n
n"; cout << "Selection: "; cin >> opt; while (opt < 1 || opt>3) { cout << "\nWrong choice!!!\n\nSelection: "; cin >> opt; } cin.ignore(); return opt; }