Advertisement
Guest User

Untitled

a guest
May 23rd, 2019
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.39 KB | None | 0 0
  1. #include<iostream>
  2. #include<string>
  3. #include<vector>
  4. #include<fstream>
  5. using namespace std;
  6.  
  7. const string alphabet= "abcdefghijklmnopqrstuvwxyz";
  8.  
  9. vector <string> sdictionary(){
  10. vector <string> box;
  11. ifstream in("note.txt");
  12. string word;
  13. for (int i = 0; i<5;i++){
  14. getline(in,word,'\n');
  15. box.push_back(word);
  16. }
  17. in.close();
  18. return box;
  19. }
  20. string cesar_encrypt(string coded_phrase){
  21.  
  22. }
  23.  
  24. string vigenere_ecrypt(string coded_phrase){
  25.  
  26. }
  27.  
  28. void encrypt(){
  29. cout << "Enter coded phrase" << endl;
  30. string coded_phrase;
  31. getline(cin,coded_phrase);
  32. while(true){
  33. cout << "Choose method to encrypt:" << endl << "1-cesar" << endl << "2-vigenere";
  34. int id_method;
  35. cin >> id_method;
  36. if (id_method == 1){
  37. cout<< cesar_encrypt(coded_phrase);
  38. break;
  39. }
  40. else if(id_method == 2){
  41. vigenere_encrypt(coded_phrase);
  42. break;
  43. }
  44. else{
  45. cout << "Choose right method" << endl;
  46. }
  47. }
  48. }
  49.  
  50. int main (){
  51. vector <string> box;
  52. box = dictionary();
  53. cout << "Enter coded phrase" << endl;
  54. string coded_phrase;
  55. getline(cin,coded_phrase);
  56. cout << "Choose method to encrypt:" << endl << "1-cesar" << endl << "2-vigenere";
  57. int id_method;
  58. cin >> id_method;
  59. if (id_method == 1){
  60. cesar_encrypt(coded_phrase);
  61. }
  62. else if(id_method == 2){
  63. vigenere_encrypt(coded_phrase);
  64. }
  65. else{
  66. cout << "Choose right method" << endl;
  67. }
  68.  
  69.  
  70.  
  71.  
  72. return 0;
  73. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement