-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPASSWORD ENCRYPTION
46 lines (44 loc) · 1.2 KB
/
PASSWORD ENCRYPTION
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
#include <iostream>
#include <string.h>
using namespace std;
void main(){
char password[50]={0};
int aux_password[50]={0};
int encrypted_password[50]={0};
char encrypted_password2[100]={0};
char final_encryption[100]={0};
int option;
cout<<"Type a password to encrypt (0-9,A-Z,a-z): ";
gets_s(password);
cout<<"Select encryption level:"<<endl;
cout<<"\t1.Simple mode."<<endl;
cout<<"\t2.Advanced mode."<<endl;
cin>>option;
switch (option){
case 1:
cout<<">>Typed password: '";
for (int i=0;i<strlen(password);i++){
cout<<password[i];
}cout<<"' "<<endl;
cout<<">>Encrypted password: ";
for(int i=0;i<strlen(password);i++){
encrypted_password[i]=password[i]+12;
cout<<encrypted_password[i];
}cout<<endl; break;
case 2: cout<<">>Typed password: '";
for (int i=0;i<strlen(password);i++){
cout<<password[i];
}cout<<"' "<<endl;
cout<<">>Encrypted password: ";
for(int i=0;i<(strlen(password)*2);i++){
aux_password[i]=password[i]+7;
encrypted_password2[2*i+1]=aux_password[i];
encrypted_password2[2*i]=i+189;
final_encryption[i]=encrypted_password2[i];
cout<<final_encryption[i];
}cout<<endl;
break;
}
cout<<"Developed by Santi Pagola."<<endl;
system("pause");
}