Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- #include<string>
- #include<vector>
- #include<fstream>
- using namespace std;
- const string alphabet= "abcdefghijklmnopqrstuvwxyz";
- vector <string> sdictionary(){
- vector <string> box;
- ifstream in("note.txt");
- string word;
- for (int i = 0; i<5;i++){
- getline(in,word,'\n');
- box.push_back(word);
- }
- in.close();
- return box;
- }
- string cesar_encrypt(string coded_phrase){
- }
- string vigenere_ecrypt(string coded_phrase){
- }
- void encrypt(){
- cout << "Enter coded phrase" << endl;
- string coded_phrase;
- getline(cin,coded_phrase);
- while(true){
- cout << "Choose method to encrypt:" << endl << "1-cesar" << endl << "2-vigenere";
- int id_method;
- cin >> id_method;
- if (id_method == 1){
- cout<< cesar_encrypt(coded_phrase);
- break;
- }
- else if(id_method == 2){
- vigenere_encrypt(coded_phrase);
- break;
- }
- else{
- cout << "Choose right method" << endl;
- }
- }
- }
- int main (){
- vector <string> box;
- box = dictionary();
- cout << "Enter coded phrase" << endl;
- string coded_phrase;
- getline(cin,coded_phrase);
- cout << "Choose method to encrypt:" << endl << "1-cesar" << endl << "2-vigenere";
- int id_method;
- cin >> id_method;
- if (id_method == 1){
- cesar_encrypt(coded_phrase);
- }
- else if(id_method == 2){
- vigenere_encrypt(coded_phrase);
- }
- else{
- cout << "Choose right method" << endl;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement