P
priyajohal
#include<fstream.h>
#include<process.h>
#include<stdlib.h>
#include<conio.h>
#include<string.h>
#include<dos.h>
#include<ctype.h>
#include<stdio.h>
void setup()
void help();
void main(int argc, char *argv[])
char color[80];
ifstream clrs;
clrs.open("graph.dsp");
if(!clrs)
{
cout<<"Important data file missing,will terminate";
getch();
exit(1);
}
for( int col=1;col<=11;col++)
{
clrs.getline(color,80);
textcolor(col);
for(int no=0;no<strlen(color);no++)
{
putch(color[no]);
delay(7.5);
}
cout<<"\n";
}
clrs.close();
textcolor(seven);
cprintf("");
cout<<"EnDe(encryptor-decryptor) version 3.0 for MS-DOS\n";
cout<<"<c> 2001 -R.G INFOTECH Ltd-project release";
unsigned long enc=5;
if(argc!=4&&argc!=2)
{
help:
cout<<"\n Encryptor-Decryptor useage help:\n";
cout<<"syntax:\n";
cout<<"\tEnDe <option> <source path and file> <target path and
file>";
cout<<"\n\nOptions:\n";
cout<<"E :Encryption Mode\n";
cout<<"D ecryption Mode\n";
cout<<"S elete Source file after Encryption\n";
cout<<"T elete Encrypted file after Decryption\n";
exit(0);
}
*argv[1]=tolower(*argv[1]);
if(argc==2)
{
if(!strcmp(argv[1],"setup")||!strcmp(argv[1],"setup")
||!strcmp(argv[1],"SETUP"))
{
char *p_set;
char set_check[8],setcheck[8],checkpass;
int length;
ifstream setup_pass;
setup_pass.open("pass.end");
if(!setup_pass)
{
ofstream ofile;
ofile.open("pass.end");
ofile<<"OE";
ofile.close();
ofile.open("ende.log",ios::trunc);
ofile.close();
setup_pass.open("pass.end");
}
setup_pass.get(checkpass);
setup_pass.getline(set_check,8);
setup_pass.close();
setup_pass.open("pass.end");
setup_pass.getline(setcheck,8);
setup_pass.close();
p_set=getpass("enter your setup password: ");
int passlen=strlen(p_set);
length=atoi(setcheck);
if(passlen==length)
{
for(int pc=0;pc<=passlen;pc++)
set_check[pc]=set_check[pc]-69;
if(!strcmp(p_set,set_check))
setup();
else
cout<<"incorrect password";
exit(0);
}
else
if(passlen!=length)
{
cout<<"incorrect password";
exit(0);
}
}
}
if(*argv[1]!='e'&&argv[1]!='d'&&*argv[1]!='s'&&*argv[1]+'t')
{
help();
}
char line,logout;
char *passw;
char *passc;
char pass1[8],pass2[8];
long =-1;
double size=1.0;
double per=1.0;
char ch;
int flag=0;
float fin;
int fin_i;
ifstream check;
ifstream ifile;
ifstream inlog;
ofstream pas;
ofstream ofile;
ofstream logfile;
logfile.open("temp.log");
ifile.open(argv[2]);
if(!ifile)
{
cout<<"Error opening Source File,will terminate";
exit(0);
}
check.open(argv[2],ios::in);
ofile.open(argv[3],ios::nonreplace);
if (!ofile)
{
cout<<"Error opening Target File,will terminate";
exit(0);
}
while(check)
{
check.get(h);
size++;
}
check.close();
if(*argv[1]=='e')
{
cout<<"Mode: Encryption\n";
error_e;
passw=getpass("Enter Password: ");
pas.open("temp.pas");
pas<<passw<<"\n";
passc=getpass("Verify Password: ");
pas<<passc;
pas.close();
check.open("temp.pas");
check.getline(pass1,8);
check.getline(pass2,8);
check.close();
system("del temp.pas");
if(!strcmp(pass1,pass2));
{
logfile<<"\n\nEncrypted "argv[2]<<"to"<<argv[3];
logfile<<"\nwith password"<<passw;
logfile.close();
logfile.open("ende.log",ios::app);
inlog.open("temp.log");
while(!inlog.eof())
{
inlog.get(logout);
logout=logout+500;
logfile<<logout;
}
logfile.close();
inlog.close();
system("del temp.log");
i=strlen(passw);
for(long k=0;k<=i;k++)
{
passw[k]=passw[k]+500;
ofile<<passw[k];
}
while(!ifile.eof())
{
ifile.get(line);
line=line+enc;
ofile<<line;
if(size<10000)
enc++;
fin=(per/size)*100;
fin_i=(int)fin;
cout<<"\r"<<fin_i<<"% Complete ";
per++;
if(size>10000)
delay(0.001);
else
delay(per);
}
cout<<"\r"<<"File Encrypted";
ifile.close();
ofile.close();
}
else
if(pass2!=pass1)
{
cout<<"Password Mismatch, Re Enter Password\n";
goto error_e;
}
}
if(*argv[1]=='s')
{
cout<<"Mode: Deletion of Soyrce Fleafter Encryption\n";
error_s:
passw=getpass("Enter Password: ");
pas.open("temp.pas");
pas<<passw<<"\n";
passc=getpass("Verify Password: ");
pas<<passc;
pas.close();
check.open("temp.pas");
check.getline(pass1,8);
check.getline(pass2,8);
check.close();
system("del temp.pas");
if(!strcmp(pass1,pass2))
{
logfile<<"Encrypted"<<argv[2]<<" to"<<argv[3];
logfile<<"\nwith password"<<pasw;
logfile.close();
logfile.open("ende.log",ios::app);
inlog.open("temp.log");
while(!inlog.eof())
{
inlog.get(logout);
logout=logout+500;
logfile<<logout;
}
logfile.close();
inlog.close();
system<"del temp.log");
i=strlen(passw);
for(long k=0;k,=i;k++)
{
passw[k]=passw[k]+500;
ofile<<passw[k];
}
while(!ifile.eof())
{
ifile.get(line);
line=line+enc;
ofile<<line;
if(size<10000)
enc++;
fin=(per/size)*100;
fin_i=(int)fin;
cout<<"\r"<<fin_i<<"% Complete";
per++;
if(size>10000)
delay(0.001);
else
delay(per);
}
cout<<"\r"<<"file Encrypted";
ifile.close();
ofile.close();
char del[80]="";
strcat(del,"del ");
strcat(del,argv[2]);
system(del);
cout<<"\nFile Deleted";
}
else
if(flag!=0)
{
cout<<"Password Mismatch,Re Enter password\n";
goto error_s;
}
}
else
if(*argv[1]=='d')
{
cout<<"Modeecryption \n";
char *passw;
passw=getpass("Enter Password:m ");
i=strlen(passw);
for(long k=0;k<=i;k++)
{
passw[k]=passw[k]+500;
ifile.get(line);
if(passw[k]!=line)
{
cout<<"Password Incorrect";
exit(0);
}
}
logfile<<"\n\nDecrypted"<<argv[2]<<"to"<<argv[3];
logfile.close();
logfile.open("EnDe.log",ios::app);
inlog.open("temp.log");
while(!inlog.eof())
{
inlog.get(logout);
logout=logout+500;
logfile<<logout;
}
logfile.close();
inlog.close();
system("del temp.log");
while(!file.eof())
{
ifile.get(line);
line=line-enc;
ofile<<line;
if(size<10000)
enc++;
fin=(per/size)*100;
fin_i=(int)fin;
cout<<"\r"<<fin_i<<"% Complete";
per++;
if(size>10000)
delay(0.001);
else
delay(per);
}
cout<<"\r"<<"File decrypted";
ifile.close();
ofile.close();
}
if(*argv[1]=='t')
{
cout<<"Mode:deletion of encrypted file after decryption\n";
passw=getpass("enter password: ");
i=strlen(passw);
for(long k=0;k<=i;k++)
{
passw[k]=passw[k]+500;
ifile.get(line);
if(passw[k]!=line)
{
cout<<"password incorrect";
exit(0);
}
}
logfile<<"\n\nDecrypted"<<argv[2]<<"to"<<argv[3];
logfile.close();
logfile.open("EnDe.log",ios::app);
inlog.open("temp.log");
while(!inlog.eof())
{
inlog.get(logout);
logout=logout+500;
logfile<<logout;
}
logfile.close();
inlog.close();
system("del temp.log");
while(!ifile.eof());
{
ifile.get(line);
line=line-enc;
ofile<<line;
if(size<10000)
enc++;
fin=(per/size)*100;
fin_i=(int)fin;
cout<<"\r"<<fin_i<<"% Complete";
per++;
if(size>10000)
delay(0.001);
else
delay(per);
}
cout<<"\r"<<"file Decrypted";
ifile.close();
ofile.close();
char del[80]="";
strcat(del,{:"del ");
strcat(del,argv[2]);
system(del);
cout<<"\nFile Deleted";
}
}
//menu.cpp
#include<iostream.h>
#include<conio.h>
#include<dos.h>
#include<stdio.h>
#include<process.h>
void view();
void log();
void set_chan();
void file();
void help();
void about();
void pass();
void setup();
{
int flag=0;
int time;
one:
flag=0;
textcolor(15);
textbackground(0);
clrscr();
union regs in,out;
cout<<"\n\n\n\n\n\n\t\t\tEnDe setup\n";
textcolor(0);
textbackground(15);
cout<<"\t\t\t";
cprintf("1.View Logfile");
cout<<"\n\t\t\t2.Clear logfile");
cout<<"\n\t\t\t3.Change Setup Password";
cout<<"\n\t\t\t4.Change Encrypted File's Password";
cout<<"\n\t\t\t5.Help On Using EnDe";
cout<<"\n\t\t\t6.About";
cout<<"\n\t\t\t7.Quit";
swone:
for(time=0;time<3000;time++)
{
delay(10);
if(kbhit())
{
flag=1;
break;
}
}
if(flag==1)
{
in.h.ah=0;
int86(22,&in,&out);
switch(out.h.ah)
{
case72:
goto seven;
case 28:
textbackground(0);
textcolor(15);
clrscr();
view();
getch();
goto one;
case 80:
goto two;
default:
goto swone;
}
}
else
{
textbackground(0);textcolor(7);
pass();
}
two:
flag=0;
textbackground(0);
textcolor(15);
clrscr();
cout<<"\n\n\n\n\n\n\n\t\t\tEnDe Setup";
textcolor(0);
textbackground(15);
cout<<"\n\t\t\t1.View logfile";
cout<<"\n\t\t\t";
cprintf("2.Clear LogFile");
cout<<"\n\t\t\t3.Change Setup Password";
cout<<"\n\t\t\t4.Change Encrypted File's Password";
cout<<"\n\t\t\t5.Help on using EnDe";
cout<<"\n\t\t\t6.About";
cout<<"\n\t\t\t7.Quit";
swtwo:
for(time=0;time<3000:time++)
{
delay(10);
if(kbhit())
{
flag=1;
break;
}
}
if(flag==1)
{
in.h.ah=0;
int86(22,&in,&out);
switch(out.h.ah)
{
case 72:
goto one;
case 28:
textbackground(0);
textcolor(15);
clrscr();
log();
goto one;
case 80:
goto three;
default:
goto swtwo;
}
}
else
{
textcolor(7);
textbackground(0);
pass();
}
three;
falg=0;
textbackground(0);
textcolor(15);
clrscr();
cout<<"\n\n\n\n\n\n\t\t\tEnDe Setup";
textcolor(0);
textbackground(15);
cout<<"\n\t\t\t1.View Logfile";
cout<<"\n\t\t\t2.Clear Logfile";
cout<<"\n\t\t\t";
cprintf("3.Change Setup Password");
cout<<"\n\t\t\t4.Change Encrypted File's Password";
cout<<"\n\t\t\t5.Help on using EnDe";
cout<<"\n\t\t\t6.About";
cout<<"\n\t\t\t7.Quit";
swthree:
for(time=0;time<3000;time++)
{
delay(10);
if(kbhit())
{
flag=1;
break;
}
}
if (flag==1)
{
in.h.ah=0;
int86(22,&in,out);
switch(out.h.ah)
{
case 72:
goto two;
case 28:
textbackground(0);
textcolor(15);
clrscr();
set_chan();
goto one;
case 80:
goto four;
default:
goto swthree;
}
}
else
{
textcolor(7)
textbackground(0)
pass();
}
four:
flag=0;
textbackground(0);
textcolor(15);
clrscr();
cout<<"\n\n\n\n\n\n\t\t\tEnDe Setup";
textcolor(0);
textbackground(15);
cout<<"\n\t\t\t1.View Logfile";
cout<<"\n\t\t\t2.Clear Logfile";
cout<<"\n\t\t\t3.Change Setup Password";
cout<<"\n\t\t\t";
cprintf("4.Change Encrypted File's Password");
cout<<"\n\t\t\t5.Help on using EnDe";
cout<<"\n\t\t\t6.About";
cout<<"\n\t\t\t7.Quit";
swfour:
for(time=0;time<3000;time++)
{
delay(10);
if(kbhit())
{
falg=1;
break;
}
}
if(flag==1)
{
in.h.ah=0;
int86(22,&in,&out);
switch(out.h.ah)
{
case72:
goto three;
case 28:
textbackground(0);
textcolor(15);
clrscr();
file();
goto one;
case 80:
goto five;
default;
goto swfour;
}
}
else
{
textcolor(7);
textbackground(0);
pass();
}
five:
flag=0;
textbackground(0);
textcolor(15);
clrscr();
cout<<"\n\n\n\n\n\n\t\t\tEnDe Setup";
textcolor(0);
textbackground(15);
cout<<"\n\t\t\t1.View Logfile";
cout<<"\n\t\t\t2.Clear Logfile";
cout<<"\n\t\t\t3.Change Setup Password";
cout<<"4.Change Encrypted File's Password";
cout<<"\n\t\t\t";
cprintf("5.Help on using EnDe");
cout<<"\n\t\t\t6.About";
cout<<"\n\t\t\t7.Quit";
swfive:
for(time=0;time<3000;time++)
{
delay(10);
if(kbhit())
{
falg=1;
break;
}
}
if(flag==1)
{
in.h.ah=0;
int86(22,&in,&out);
switch(out.h.ah)
{
case72:
goto four;
case 28:
textbackground(0);
textcolor(15);
clrscr();
help();
getch();
goto one;
case 80:
goto six;
default:
goto swfive;
}
}
else
{
textcolor(7);
textbackground(0);
pass();
}
six:
flag=0;
textbackground(0);
textcolor(15);
clrscr();
cout<<"\n\n\n\n\n\n\t\t\tEnDe Setup";
textcolor(0);
textbackground(15);
cout<<"\n\t\t\t1.View Logfile";
cout<<"\n\t\t\t2.Clear Logfile";
cout<<"\n\t\t\t3.Change Setup Password";
cout<<"4.Change Encrypted File's Password";
cout<<"\n\t\t\t5.Help on using EnDe";
cout<<"\n\t\t\t";
cprintf("6.About");
cout<<"\n\t\t\t7.Quit";
swsix:
for(time=0;time<3000;time++)
{
delay(10);
if(kbhit())
{
falg=1;
break;
}
}
if(flag==1)
{
in.h.ah=0;
int86(22,&in,&out);
switch(out.h.ah)
{
case72:
goto five;
case 28:
textbackground(0);
textcolor(15);
clrscr();
about();
getch();
goto one;
case 80:
goto seven;
default:
goto swsix;
}
}
else
{
textcolor(7);
textbackground(0);
pass();
}
seven:
flag=0;
textbackground(0);
textcolor(15);
clrscr();
cout<<"\n\n\n\n\n\n\t\t\tEnDe Setup";
textcolor(0);
textbackground(15);
cout<<"\n\t\t\t1.View Logfile";
cout<<"\n\t\t\t2.Clear Logfile";
cout<<"3.Change Setup password";
cout<<"\n\t\t\t4.Change Encrypted File's Password";
cout<<"5.Help on using EnDe";
cout<<"\n\t\t\t6.About";
cout<<"\n\t\t\t";
cprintf("7.Quit");
swseven:
for(time=0;time<3000;time++)
{
delay(10);
if (kbhit())
{
flag=1;
break;
}
}
if (flag==1)
{
in.h.ah=0;
int86(22,&in,&out);
switch(out.h.ah)
{
case72:
soto six;
case 28:
tetbackground(0);
textcolor(15);
clrscr();
exit(0);
getch();
goto one;
case 80:
goto one;
default:
goto swseven;
}
}
else{
textcolor(7);
textbackground(0);
pass();
}
}
}
#include<fstream.h>
#include<conio.h>
void view()
{
clrscr();
ifstream ifile;
char line;
while(ifile)
{
ifile.open("ende.log");
line=line-500;
cout<<line;
}
}
#include<fstream.h>
#include<conio.h>
#include<dos.h>
void log()
{
cout<<"Are you sure you want to clear the log fike?(y/n)";
char ch;
cin>>ch;
if(ch=='y'||ch=='Y')
{
ofstream clear;
clear.open("ende.log",ios::trunc);
clear.close();
cout<<"Log file clearde";
getch();
}
}
#include<fstream.h>
#include<conio.h>
#include<string.h>
#include<stdio.h>
#include<process.h>
void file()
{
int=-1;
ifstream ifile;
char *fname;
char line;
char *passw,*passc;
char pass[8],pass2[8];
cout<<"Enter the name and path of the file:";
cout<<"\nNote:TO the password of a file you must be in the
directory holding the file";
cout<<"\nEnDe:\>";
gets(fname);
ifile.open(fname);
if(!ifile)
{
cout<<"Could not open file";
exit(1);
}
passw=getpass("Enter current Password:");
i=strlen(passw);
for(ini k=0;k<=1;k++)
{
passw[k]=passw[k]+500;
ifile.get(line);
if(passw[k]!=line)
{
cout<<"Password Incorrect";
exit(0);
}
}
ofstream ofile;
ifstream check;
ofile.open("temp.pad");
passw=getpass("Enter new password:");
ofile<<passw<<"\n";
passc=getpass("Verify Password");
ofile<<passc;
ofile.close();
check.open("temp.pas");
check.getline(pass1,8);
check.getline(pass2,8);
check.close();
system("del temp.pas");
if(!strcmp(pass1,pass2))
{
ofile.open("temp.tem");
i=strlen(pass1);
for(k=0;k<=i;k++)
{
pass1[k]=pass1[k]+500;
ofile<<pass1[k];
}
while(!ifile.eof())
{
ifile.get(line);
ofile<<line;
}
cout<<"Password changed successfully";
}
char source[50]="",dest[50]="";
strcat(source,"del ");
strcat(source,fname);
strcat(dest,"ren");
strcat(dest,"temp.tem");
ofile.close();
ifile.close();
strcat(dest,fname);
system(source);
system(dest);
}
#include<fstream.h>
#include<conio.h>
#include<string.h>
#include<stdlib.h>
void set_chan()
{
ofstream setup;
ifstream check;
char *pass,*passc;
char pass1[8],pass2[8];
setup.open("temp.pas");
pass=getpass("New Password:");
int passlen=strlen(pass);
setup<<pass<<"\n";
passc=getpass<"Verify Password:");
setup<<pasc;
setup.close();
check.open("temp.pas");
check.getline(pass1,8);
check.getline(pass2,8);
check.close();
system("del temp.pas");
setup.open"pass.end");
if(!strcmp(pass1,pass2))
{
setup<<passlen;
for(int i=0;i<=passlen;i++)
{
pass1=pass1+69;
setup<<pass1;
}
cout<<"The password has been changed successfully";
}
else
cout<<"The Passwords do not match";
getch();
setup.close();
}
#include<iostream.h>
#include<conio.h>
void help()
{
clrscr();
cout<"\nEncryptor-Decryptor ver 3.0 usage help:\n";
cout<<"Syntax:\n";
cout<<"\tEnDe<option><source path and file><target path and file>
\n";
cout<<"\n\nOptions:\n";
cout<<"E :Encryption Mode\n";
cout<<"D ecryption Mode\n";
cout<<"S elete Source file after Encryption\n";
cout<<"T elete Encrypted file afte decryptionn\n";
cout<<"\n\nOr when in EnDe Setup mode,there are five options:\n";
cout<<"1.Clear log File:\n";
cout<<"\tLog File is a file which keeps the history of all the
operations\n";
cout<<"\tcarried out through EnDe,in an encrypted format\n";
cout<<"\t This fynction clears the log file so no one can retrieve
the password\n";
cout<<"\tof any of your encrypted files if he knows your setup
password\n";
cout<<"\n\n\n\n||more||";
getch();
clrscr();
cout<<"2.Change the setup password:\n";
cout<<"\tThis function changes the setup password through which you
can\n";
cout<<"\tagain access to the Setup Menu\n";
cout<<"3.Change the password of an encrypted file:\n";
cout<<"\tThis function changes the password of an already encrypted
file\n";
cout<<"\n4.Help\n";
cout<<"\nAbout:\n";
cout<<"\tGives version information and the names of the developers(s)
\n";
cout<<"\n6.Quit:\n";
cout<<"\tQuit EnDe Setup Menu\n";
}
#include<iostream.h>
#include<conio.h>
void about()
{
clrscr();
cout<<"(Encryptor-Decryptor)version3.0 for MS-DOS\n";
cout<<"<c>2001- R.G.Infotech Ltd.-Project Release\n";
}
#include<fstream.h>
#include<stdlib.h>
#include<string.h>
#include<dos.h>
#include<conio.h>
void setup();
void pass()
{
char *p_set;
char set_check[8],setcheck[8],checkpass;
int length;
ifstream setup_pass;
setup_pass.open("pass.end");
setup_pass.get(checkpass);
setup_pass.getline(set_check,8);
setup_pass.close();
setup_pass.open("pass.end");
setup_pass.getline(setcheck,8);
setup_pass.close();
clrscr();
char color[80];
ifstream clrs;
clrs.open("graph.dsp");
for(int col=1;col<=11;col++)
{
clrs.getline(color,80);
textcolor(col);
for(int no=0;no<strlen(color);no++)
{
putch(color[no]);
delay(7.5);
}
cout<<"\n";
}
clrs.close();
textcolor(10);
int pc;
pcheck:
p_set=getpass("Enter your setup password:");
int passlen=strlen(p_set);
length=atoi(setcheck);
if(passlen==length)
{
for(pc=0;pc<=passlen;pc++)
p_set[pc]=p_set[pc]+69;
if(!strcmp(p_set,set_check))
setup();
else
goto pcheck;
}
else
goto pcheck;
}
#include<process.h>
#include<stdlib.h>
#include<conio.h>
#include<string.h>
#include<dos.h>
#include<ctype.h>
#include<stdio.h>
void setup()
void help();
void main(int argc, char *argv[])
char color[80];
ifstream clrs;
clrs.open("graph.dsp");
if(!clrs)
{
cout<<"Important data file missing,will terminate";
getch();
exit(1);
}
for( int col=1;col<=11;col++)
{
clrs.getline(color,80);
textcolor(col);
for(int no=0;no<strlen(color);no++)
{
putch(color[no]);
delay(7.5);
}
cout<<"\n";
}
clrs.close();
textcolor(seven);
cprintf("");
cout<<"EnDe(encryptor-decryptor) version 3.0 for MS-DOS\n";
cout<<"<c> 2001 -R.G INFOTECH Ltd-project release";
unsigned long enc=5;
if(argc!=4&&argc!=2)
{
help:
cout<<"\n Encryptor-Decryptor useage help:\n";
cout<<"syntax:\n";
cout<<"\tEnDe <option> <source path and file> <target path and
file>";
cout<<"\n\nOptions:\n";
cout<<"E :Encryption Mode\n";
cout<<"D ecryption Mode\n";
cout<<"S elete Source file after Encryption\n";
cout<<"T elete Encrypted file after Decryption\n";
exit(0);
}
*argv[1]=tolower(*argv[1]);
if(argc==2)
{
if(!strcmp(argv[1],"setup")||!strcmp(argv[1],"setup")
||!strcmp(argv[1],"SETUP"))
{
char *p_set;
char set_check[8],setcheck[8],checkpass;
int length;
ifstream setup_pass;
setup_pass.open("pass.end");
if(!setup_pass)
{
ofstream ofile;
ofile.open("pass.end");
ofile<<"OE";
ofile.close();
ofile.open("ende.log",ios::trunc);
ofile.close();
setup_pass.open("pass.end");
}
setup_pass.get(checkpass);
setup_pass.getline(set_check,8);
setup_pass.close();
setup_pass.open("pass.end");
setup_pass.getline(setcheck,8);
setup_pass.close();
p_set=getpass("enter your setup password: ");
int passlen=strlen(p_set);
length=atoi(setcheck);
if(passlen==length)
{
for(int pc=0;pc<=passlen;pc++)
set_check[pc]=set_check[pc]-69;
if(!strcmp(p_set,set_check))
setup();
else
cout<<"incorrect password";
exit(0);
}
else
if(passlen!=length)
{
cout<<"incorrect password";
exit(0);
}
}
}
if(*argv[1]!='e'&&argv[1]!='d'&&*argv[1]!='s'&&*argv[1]+'t')
{
help();
}
char line,logout;
char *passw;
char *passc;
char pass1[8],pass2[8];
long =-1;
double size=1.0;
double per=1.0;
char ch;
int flag=0;
float fin;
int fin_i;
ifstream check;
ifstream ifile;
ifstream inlog;
ofstream pas;
ofstream ofile;
ofstream logfile;
logfile.open("temp.log");
ifile.open(argv[2]);
if(!ifile)
{
cout<<"Error opening Source File,will terminate";
exit(0);
}
check.open(argv[2],ios::in);
ofile.open(argv[3],ios::nonreplace);
if (!ofile)
{
cout<<"Error opening Target File,will terminate";
exit(0);
}
while(check)
{
check.get(h);
size++;
}
check.close();
if(*argv[1]=='e')
{
cout<<"Mode: Encryption\n";
error_e;
passw=getpass("Enter Password: ");
pas.open("temp.pas");
pas<<passw<<"\n";
passc=getpass("Verify Password: ");
pas<<passc;
pas.close();
check.open("temp.pas");
check.getline(pass1,8);
check.getline(pass2,8);
check.close();
system("del temp.pas");
if(!strcmp(pass1,pass2));
{
logfile<<"\n\nEncrypted "argv[2]<<"to"<<argv[3];
logfile<<"\nwith password"<<passw;
logfile.close();
logfile.open("ende.log",ios::app);
inlog.open("temp.log");
while(!inlog.eof())
{
inlog.get(logout);
logout=logout+500;
logfile<<logout;
}
logfile.close();
inlog.close();
system("del temp.log");
i=strlen(passw);
for(long k=0;k<=i;k++)
{
passw[k]=passw[k]+500;
ofile<<passw[k];
}
while(!ifile.eof())
{
ifile.get(line);
line=line+enc;
ofile<<line;
if(size<10000)
enc++;
fin=(per/size)*100;
fin_i=(int)fin;
cout<<"\r"<<fin_i<<"% Complete ";
per++;
if(size>10000)
delay(0.001);
else
delay(per);
}
cout<<"\r"<<"File Encrypted";
ifile.close();
ofile.close();
}
else
if(pass2!=pass1)
{
cout<<"Password Mismatch, Re Enter Password\n";
goto error_e;
}
}
if(*argv[1]=='s')
{
cout<<"Mode: Deletion of Soyrce Fleafter Encryption\n";
error_s:
passw=getpass("Enter Password: ");
pas.open("temp.pas");
pas<<passw<<"\n";
passc=getpass("Verify Password: ");
pas<<passc;
pas.close();
check.open("temp.pas");
check.getline(pass1,8);
check.getline(pass2,8);
check.close();
system("del temp.pas");
if(!strcmp(pass1,pass2))
{
logfile<<"Encrypted"<<argv[2]<<" to"<<argv[3];
logfile<<"\nwith password"<<pasw;
logfile.close();
logfile.open("ende.log",ios::app);
inlog.open("temp.log");
while(!inlog.eof())
{
inlog.get(logout);
logout=logout+500;
logfile<<logout;
}
logfile.close();
inlog.close();
system<"del temp.log");
i=strlen(passw);
for(long k=0;k,=i;k++)
{
passw[k]=passw[k]+500;
ofile<<passw[k];
}
while(!ifile.eof())
{
ifile.get(line);
line=line+enc;
ofile<<line;
if(size<10000)
enc++;
fin=(per/size)*100;
fin_i=(int)fin;
cout<<"\r"<<fin_i<<"% Complete";
per++;
if(size>10000)
delay(0.001);
else
delay(per);
}
cout<<"\r"<<"file Encrypted";
ifile.close();
ofile.close();
char del[80]="";
strcat(del,"del ");
strcat(del,argv[2]);
system(del);
cout<<"\nFile Deleted";
}
else
if(flag!=0)
{
cout<<"Password Mismatch,Re Enter password\n";
goto error_s;
}
}
else
if(*argv[1]=='d')
{
cout<<"Modeecryption \n";
char *passw;
passw=getpass("Enter Password:m ");
i=strlen(passw);
for(long k=0;k<=i;k++)
{
passw[k]=passw[k]+500;
ifile.get(line);
if(passw[k]!=line)
{
cout<<"Password Incorrect";
exit(0);
}
}
logfile<<"\n\nDecrypted"<<argv[2]<<"to"<<argv[3];
logfile.close();
logfile.open("EnDe.log",ios::app);
inlog.open("temp.log");
while(!inlog.eof())
{
inlog.get(logout);
logout=logout+500;
logfile<<logout;
}
logfile.close();
inlog.close();
system("del temp.log");
while(!file.eof())
{
ifile.get(line);
line=line-enc;
ofile<<line;
if(size<10000)
enc++;
fin=(per/size)*100;
fin_i=(int)fin;
cout<<"\r"<<fin_i<<"% Complete";
per++;
if(size>10000)
delay(0.001);
else
delay(per);
}
cout<<"\r"<<"File decrypted";
ifile.close();
ofile.close();
}
if(*argv[1]=='t')
{
cout<<"Mode:deletion of encrypted file after decryption\n";
passw=getpass("enter password: ");
i=strlen(passw);
for(long k=0;k<=i;k++)
{
passw[k]=passw[k]+500;
ifile.get(line);
if(passw[k]!=line)
{
cout<<"password incorrect";
exit(0);
}
}
logfile<<"\n\nDecrypted"<<argv[2]<<"to"<<argv[3];
logfile.close();
logfile.open("EnDe.log",ios::app);
inlog.open("temp.log");
while(!inlog.eof())
{
inlog.get(logout);
logout=logout+500;
logfile<<logout;
}
logfile.close();
inlog.close();
system("del temp.log");
while(!ifile.eof());
{
ifile.get(line);
line=line-enc;
ofile<<line;
if(size<10000)
enc++;
fin=(per/size)*100;
fin_i=(int)fin;
cout<<"\r"<<fin_i<<"% Complete";
per++;
if(size>10000)
delay(0.001);
else
delay(per);
}
cout<<"\r"<<"file Decrypted";
ifile.close();
ofile.close();
char del[80]="";
strcat(del,{:"del ");
strcat(del,argv[2]);
system(del);
cout<<"\nFile Deleted";
}
}
//menu.cpp
#include<iostream.h>
#include<conio.h>
#include<dos.h>
#include<stdio.h>
#include<process.h>
void view();
void log();
void set_chan();
void file();
void help();
void about();
void pass();
void setup();
{
int flag=0;
int time;
one:
flag=0;
textcolor(15);
textbackground(0);
clrscr();
union regs in,out;
cout<<"\n\n\n\n\n\n\t\t\tEnDe setup\n";
textcolor(0);
textbackground(15);
cout<<"\t\t\t";
cprintf("1.View Logfile");
cout<<"\n\t\t\t2.Clear logfile");
cout<<"\n\t\t\t3.Change Setup Password";
cout<<"\n\t\t\t4.Change Encrypted File's Password";
cout<<"\n\t\t\t5.Help On Using EnDe";
cout<<"\n\t\t\t6.About";
cout<<"\n\t\t\t7.Quit";
swone:
for(time=0;time<3000;time++)
{
delay(10);
if(kbhit())
{
flag=1;
break;
}
}
if(flag==1)
{
in.h.ah=0;
int86(22,&in,&out);
switch(out.h.ah)
{
case72:
goto seven;
case 28:
textbackground(0);
textcolor(15);
clrscr();
view();
getch();
goto one;
case 80:
goto two;
default:
goto swone;
}
}
else
{
textbackground(0);textcolor(7);
pass();
}
two:
flag=0;
textbackground(0);
textcolor(15);
clrscr();
cout<<"\n\n\n\n\n\n\n\t\t\tEnDe Setup";
textcolor(0);
textbackground(15);
cout<<"\n\t\t\t1.View logfile";
cout<<"\n\t\t\t";
cprintf("2.Clear LogFile");
cout<<"\n\t\t\t3.Change Setup Password";
cout<<"\n\t\t\t4.Change Encrypted File's Password";
cout<<"\n\t\t\t5.Help on using EnDe";
cout<<"\n\t\t\t6.About";
cout<<"\n\t\t\t7.Quit";
swtwo:
for(time=0;time<3000:time++)
{
delay(10);
if(kbhit())
{
flag=1;
break;
}
}
if(flag==1)
{
in.h.ah=0;
int86(22,&in,&out);
switch(out.h.ah)
{
case 72:
goto one;
case 28:
textbackground(0);
textcolor(15);
clrscr();
log();
goto one;
case 80:
goto three;
default:
goto swtwo;
}
}
else
{
textcolor(7);
textbackground(0);
pass();
}
three;
falg=0;
textbackground(0);
textcolor(15);
clrscr();
cout<<"\n\n\n\n\n\n\t\t\tEnDe Setup";
textcolor(0);
textbackground(15);
cout<<"\n\t\t\t1.View Logfile";
cout<<"\n\t\t\t2.Clear Logfile";
cout<<"\n\t\t\t";
cprintf("3.Change Setup Password");
cout<<"\n\t\t\t4.Change Encrypted File's Password";
cout<<"\n\t\t\t5.Help on using EnDe";
cout<<"\n\t\t\t6.About";
cout<<"\n\t\t\t7.Quit";
swthree:
for(time=0;time<3000;time++)
{
delay(10);
if(kbhit())
{
flag=1;
break;
}
}
if (flag==1)
{
in.h.ah=0;
int86(22,&in,out);
switch(out.h.ah)
{
case 72:
goto two;
case 28:
textbackground(0);
textcolor(15);
clrscr();
set_chan();
goto one;
case 80:
goto four;
default:
goto swthree;
}
}
else
{
textcolor(7)
textbackground(0)
pass();
}
four:
flag=0;
textbackground(0);
textcolor(15);
clrscr();
cout<<"\n\n\n\n\n\n\t\t\tEnDe Setup";
textcolor(0);
textbackground(15);
cout<<"\n\t\t\t1.View Logfile";
cout<<"\n\t\t\t2.Clear Logfile";
cout<<"\n\t\t\t3.Change Setup Password";
cout<<"\n\t\t\t";
cprintf("4.Change Encrypted File's Password");
cout<<"\n\t\t\t5.Help on using EnDe";
cout<<"\n\t\t\t6.About";
cout<<"\n\t\t\t7.Quit";
swfour:
for(time=0;time<3000;time++)
{
delay(10);
if(kbhit())
{
falg=1;
break;
}
}
if(flag==1)
{
in.h.ah=0;
int86(22,&in,&out);
switch(out.h.ah)
{
case72:
goto three;
case 28:
textbackground(0);
textcolor(15);
clrscr();
file();
goto one;
case 80:
goto five;
default;
goto swfour;
}
}
else
{
textcolor(7);
textbackground(0);
pass();
}
five:
flag=0;
textbackground(0);
textcolor(15);
clrscr();
cout<<"\n\n\n\n\n\n\t\t\tEnDe Setup";
textcolor(0);
textbackground(15);
cout<<"\n\t\t\t1.View Logfile";
cout<<"\n\t\t\t2.Clear Logfile";
cout<<"\n\t\t\t3.Change Setup Password";
cout<<"4.Change Encrypted File's Password";
cout<<"\n\t\t\t";
cprintf("5.Help on using EnDe");
cout<<"\n\t\t\t6.About";
cout<<"\n\t\t\t7.Quit";
swfive:
for(time=0;time<3000;time++)
{
delay(10);
if(kbhit())
{
falg=1;
break;
}
}
if(flag==1)
{
in.h.ah=0;
int86(22,&in,&out);
switch(out.h.ah)
{
case72:
goto four;
case 28:
textbackground(0);
textcolor(15);
clrscr();
help();
getch();
goto one;
case 80:
goto six;
default:
goto swfive;
}
}
else
{
textcolor(7);
textbackground(0);
pass();
}
six:
flag=0;
textbackground(0);
textcolor(15);
clrscr();
cout<<"\n\n\n\n\n\n\t\t\tEnDe Setup";
textcolor(0);
textbackground(15);
cout<<"\n\t\t\t1.View Logfile";
cout<<"\n\t\t\t2.Clear Logfile";
cout<<"\n\t\t\t3.Change Setup Password";
cout<<"4.Change Encrypted File's Password";
cout<<"\n\t\t\t5.Help on using EnDe";
cout<<"\n\t\t\t";
cprintf("6.About");
cout<<"\n\t\t\t7.Quit";
swsix:
for(time=0;time<3000;time++)
{
delay(10);
if(kbhit())
{
falg=1;
break;
}
}
if(flag==1)
{
in.h.ah=0;
int86(22,&in,&out);
switch(out.h.ah)
{
case72:
goto five;
case 28:
textbackground(0);
textcolor(15);
clrscr();
about();
getch();
goto one;
case 80:
goto seven;
default:
goto swsix;
}
}
else
{
textcolor(7);
textbackground(0);
pass();
}
seven:
flag=0;
textbackground(0);
textcolor(15);
clrscr();
cout<<"\n\n\n\n\n\n\t\t\tEnDe Setup";
textcolor(0);
textbackground(15);
cout<<"\n\t\t\t1.View Logfile";
cout<<"\n\t\t\t2.Clear Logfile";
cout<<"3.Change Setup password";
cout<<"\n\t\t\t4.Change Encrypted File's Password";
cout<<"5.Help on using EnDe";
cout<<"\n\t\t\t6.About";
cout<<"\n\t\t\t";
cprintf("7.Quit");
swseven:
for(time=0;time<3000;time++)
{
delay(10);
if (kbhit())
{
flag=1;
break;
}
}
if (flag==1)
{
in.h.ah=0;
int86(22,&in,&out);
switch(out.h.ah)
{
case72:
soto six;
case 28:
tetbackground(0);
textcolor(15);
clrscr();
exit(0);
getch();
goto one;
case 80:
goto one;
default:
goto swseven;
}
}
else{
textcolor(7);
textbackground(0);
pass();
}
}
}
#include<fstream.h>
#include<conio.h>
void view()
{
clrscr();
ifstream ifile;
char line;
while(ifile)
{
ifile.open("ende.log");
line=line-500;
cout<<line;
}
}
#include<fstream.h>
#include<conio.h>
#include<dos.h>
void log()
{
cout<<"Are you sure you want to clear the log fike?(y/n)";
char ch;
cin>>ch;
if(ch=='y'||ch=='Y')
{
ofstream clear;
clear.open("ende.log",ios::trunc);
clear.close();
cout<<"Log file clearde";
getch();
}
}
#include<fstream.h>
#include<conio.h>
#include<string.h>
#include<stdio.h>
#include<process.h>
void file()
{
int=-1;
ifstream ifile;
char *fname;
char line;
char *passw,*passc;
char pass[8],pass2[8];
cout<<"Enter the name and path of the file:";
cout<<"\nNote:TO the password of a file you must be in the
directory holding the file";
cout<<"\nEnDe:\>";
gets(fname);
ifile.open(fname);
if(!ifile)
{
cout<<"Could not open file";
exit(1);
}
passw=getpass("Enter current Password:");
i=strlen(passw);
for(ini k=0;k<=1;k++)
{
passw[k]=passw[k]+500;
ifile.get(line);
if(passw[k]!=line)
{
cout<<"Password Incorrect";
exit(0);
}
}
ofstream ofile;
ifstream check;
ofile.open("temp.pad");
passw=getpass("Enter new password:");
ofile<<passw<<"\n";
passc=getpass("Verify Password");
ofile<<passc;
ofile.close();
check.open("temp.pas");
check.getline(pass1,8);
check.getline(pass2,8);
check.close();
system("del temp.pas");
if(!strcmp(pass1,pass2))
{
ofile.open("temp.tem");
i=strlen(pass1);
for(k=0;k<=i;k++)
{
pass1[k]=pass1[k]+500;
ofile<<pass1[k];
}
while(!ifile.eof())
{
ifile.get(line);
ofile<<line;
}
cout<<"Password changed successfully";
}
char source[50]="",dest[50]="";
strcat(source,"del ");
strcat(source,fname);
strcat(dest,"ren");
strcat(dest,"temp.tem");
ofile.close();
ifile.close();
strcat(dest,fname);
system(source);
system(dest);
}
#include<fstream.h>
#include<conio.h>
#include<string.h>
#include<stdlib.h>
void set_chan()
{
ofstream setup;
ifstream check;
char *pass,*passc;
char pass1[8],pass2[8];
setup.open("temp.pas");
pass=getpass("New Password:");
int passlen=strlen(pass);
setup<<pass<<"\n";
passc=getpass<"Verify Password:");
setup<<pasc;
setup.close();
check.open("temp.pas");
check.getline(pass1,8);
check.getline(pass2,8);
check.close();
system("del temp.pas");
setup.open"pass.end");
if(!strcmp(pass1,pass2))
{
setup<<passlen;
for(int i=0;i<=passlen;i++)
{
pass1=pass1+69;
setup<<pass1;
}
cout<<"The password has been changed successfully";
}
else
cout<<"The Passwords do not match";
getch();
setup.close();
}
#include<iostream.h>
#include<conio.h>
void help()
{
clrscr();
cout<"\nEncryptor-Decryptor ver 3.0 usage help:\n";
cout<<"Syntax:\n";
cout<<"\tEnDe<option><source path and file><target path and file>
\n";
cout<<"\n\nOptions:\n";
cout<<"E :Encryption Mode\n";
cout<<"D ecryption Mode\n";
cout<<"S elete Source file after Encryption\n";
cout<<"T elete Encrypted file afte decryptionn\n";
cout<<"\n\nOr when in EnDe Setup mode,there are five options:\n";
cout<<"1.Clear log File:\n";
cout<<"\tLog File is a file which keeps the history of all the
operations\n";
cout<<"\tcarried out through EnDe,in an encrypted format\n";
cout<<"\t This fynction clears the log file so no one can retrieve
the password\n";
cout<<"\tof any of your encrypted files if he knows your setup
password\n";
cout<<"\n\n\n\n||more||";
getch();
clrscr();
cout<<"2.Change the setup password:\n";
cout<<"\tThis function changes the setup password through which you
can\n";
cout<<"\tagain access to the Setup Menu\n";
cout<<"3.Change the password of an encrypted file:\n";
cout<<"\tThis function changes the password of an already encrypted
file\n";
cout<<"\n4.Help\n";
cout<<"\nAbout:\n";
cout<<"\tGives version information and the names of the developers(s)
\n";
cout<<"\n6.Quit:\n";
cout<<"\tQuit EnDe Setup Menu\n";
}
#include<iostream.h>
#include<conio.h>
void about()
{
clrscr();
cout<<"(Encryptor-Decryptor)version3.0 for MS-DOS\n";
cout<<"<c>2001- R.G.Infotech Ltd.-Project Release\n";
}
#include<fstream.h>
#include<stdlib.h>
#include<string.h>
#include<dos.h>
#include<conio.h>
void setup();
void pass()
{
char *p_set;
char set_check[8],setcheck[8],checkpass;
int length;
ifstream setup_pass;
setup_pass.open("pass.end");
setup_pass.get(checkpass);
setup_pass.getline(set_check,8);
setup_pass.close();
setup_pass.open("pass.end");
setup_pass.getline(setcheck,8);
setup_pass.close();
clrscr();
char color[80];
ifstream clrs;
clrs.open("graph.dsp");
for(int col=1;col<=11;col++)
{
clrs.getline(color,80);
textcolor(col);
for(int no=0;no<strlen(color);no++)
{
putch(color[no]);
delay(7.5);
}
cout<<"\n";
}
clrs.close();
textcolor(10);
int pc;
pcheck:
p_set=getpass("Enter your setup password:");
int passlen=strlen(p_set);
length=atoi(setcheck);
if(passlen==length)
{
for(pc=0;pc<=passlen;pc++)
p_set[pc]=p_set[pc]+69;
if(!strcmp(p_set,set_check))
setup();
else
goto pcheck;
}
else
goto pcheck;
}