-
Notifications
You must be signed in to change notification settings - Fork 1
/
key.cpp
81 lines (73 loc) · 1.88 KB
/
key.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
#include <iostream>
#include <string.h>
#include "lib/enc.h"
#include "lib/dec.h"
#include "lib/banner.h"
#if defined(__linux__) // any linux distribution
#define CLS "clear"
#elif defined(_WIN32) // any windows system
#define CLS "cls"
#else
#define CLS "clear"
#endif
using namespace std;
int main() {
system(CLS);
int i, input;
string str;
cout<<banner<<
"\e[33m [!] Please choose following options: \n\n"
"\e[36m [1] Encrypt string. \n\n"
" [2] Decrypt string. \n\n"
" [3] Encrypt File. \n\n"
" [4] Decrypt File. \n\n"
" [5] Exit \e[0m\n\n"
<<ask("MENU");
fr:
cin >> input;
switch(input) {
case 1:
system(CLS);
cout<<banner<<
"\e[33m [!] Please Enter String: \n\n"
<<ask("Encrypt STR");
getline(cin >> ws,str);
for(i = 0; (i < 100 && str[i] != '\0'); i++)
str[i] = str[i] + 2;
cout << "\e[31m\n[+] Encrypted string: \e[0m" << str << endl;
break;
case 2:
system(CLS);
cout<<banner<<
"\e[33m [!] Please Enter String: \n\n"
<<ask("Decrypt STR");
getline(cin >> ws ,str);
for(i = 0; (i < 100 && str[i] != '\0'); i++)
str[i] = str[i] - 2;
cout << "\e[31m\nDecrypted string: \e[0m" << str << endl;
break;
case 3:
system(CLS);
cout<<banner<<
"\e[33m [!] Please Enter Dir File: \n\n"
<<ask("Encrypt File ("+pwd()+")");
vector1 one;
one.center();
break;
case 4:
system(CLS);
cout<<banner<<
"\e[33m [!] Please Enter Dir File: \n\n"
<<ask("Decrypt File ("+pwd()+")");
vector2 two;
two.center2();
break;
case 5:
exit(0);
default:
cout << "\e[32m[-] Invalid Input !!! \e[0m\n";
goto fr;
break;
}
return 0;
}