Professional Documents
Culture Documents
void doEncryption():
void doDecryption():
This does the same process of the above function but it decrypts the
encrypted data it hold the decryption key by multiplying the encryption key
with -1.
EncryptionDecryption():
This is the constructor of the class in its name this function is used to
initialize the values such as key and other parameters.
EncryptionDecryption(string):
void setEncPass(string):
~EncryptionDecryption():
This is the destructor of the class in its name, even thou it is not
necessary in this source code it have been used for the programming practices.
int checkEncPass(string)
int checkDecPass(string):
void getOutputString():
int main()
The main() in this program is used to give the interface to the user by
displaying the option and conducting simple condition check to verify the
password and the input options are valid.
EXISTING SYSTEM AND PROPOSED SYSTEM
Existing System:
The existing system also doesn’t involve the key much in the process of
encryption with plain text which makes the chipper to be cracked easily.
Proposed System:
HARDWARE SPECIFICATION :
RAM : 4GB.
VDU : 1366x768p
SOFTWARE SPECIFICATION:
Architecture : x64
Compilers
Code editor
The IDE features syntax highlighting and code folding (through its Scintilla
editor component), C++ code completion, class browser, a hex editor and many
other utilities. Opened files are organized into tabs. The code editor supports
font and font size selection and personalized syntax highlighting colours.
Debugger
The Code::Blocks debugger has full breakpoint support. It also allows the user
to debug their program by having access to the local function symbol and
argument display, user-defined watches, call stack, disassembly, custom
memory dump, thread switching, CPU registers and GNU Debugger Interface.
GUI designer
User migration
Some of Code::Blocks features are targeted at users migrating from other IDE's
- these include Dev-C++, Microsoft Visual C++ project import (MSVC 7 & 10),
and Dev-C++ Devpak support.
Code::Blocks uses a custom build system, which stores its information in XML-
based project files. It can optionally use external makefiles, which simplifies
interfacing with projects using the GNU or qmake build systems.
SOURCE CODE
#include<iostream>
#include<fstream>
#include<iomanip>
#include<string.h>
#include<dos.h>
class EncryptionDecryption {
private:
string outputstring;
string inputstring;
string encpass;
string decpass;
int enckey;
int deckey;
int temp;
char tempc;
void doEncryption();
void doDecryption();
public:
EncryptionDecryption();
EncryptionDecryption(string);
void setEncPass(string);
void setInputString(string);
~EncryptionDecryption();
int checkEncPass(string);
int checkDecPass(string);
void getOutputString();
};
void EncryptionDecryption::doEncryption() {
for(int i=0;i<inputstring.size();i++) {
temp = (int)inputstring[i];
tempc = (char)temp;
outputstring += tempc;
void EncryptionDecryption::doDecryption() {
for(int i=0;i<inputstring.size();i++) {
temp = (int)inputstring[i];
tempc = (char)temp;
outputstring += tempc;
void EncryptionDecryption::getOutputString() {
outputstring += '\0';
outputstring="";
if(pass!=encpass)
cout << endl << "The password you entered is Incorrect the Encryption will not proceed.\nTry
Again \n";
return 0;
else {
doEncryption();
return 1;
fstream fio("keyfile.txt",ios::out);
encpass=pass;
fio<<pass;
fstream fio("keyfile.txt",ios::in);
string tpass;
cin.ignore();
fio>>tpass;
if(pass!=tpass)
cout << endl << "The password you entered is Incorrect the, Decryption will not proceed.\nTry
Again \n";
return 0;
else {
doDecryption();
return 1;
EncryptionDecryption::EncryptionDecryption() {
inputstring = "";
outputstring = "";
encpass= "";
decpass= "";
enckey= 5;
deckey= -1 * enckey;
temp= 0;
tempc='\0';
}
EncryptionDecryption::EncryptionDecryption(string e) {
inputstring = e;
void EncryptionDecryption::setInputString(string f) {
inputstring=f;
EncryptionDecryption::~EncryptionDecryption() {
int main()
string inputstring;
string pass;
char ch;
bool quit=false;
EncryptionDecryption O1;
while(!quit)
quit = false;
cout << "\nEnter the choice to perform the task";
switch(ch)
case '1':
cin.ignore();
getline(cin, inputstring);
O1.setInputString(inputstring);
getline(cin, pass);
O1.setEncPass(pass);
if(O1.checkEncPass(pass)==1) {
O1.getOutputString();
else {
break;
break;
case '2':
cin.ignore();
getline(cin, inputstring);
O1.setInputString(inputstring);
getline(cin, pass);
if(O1.checkDecPass(pass)==1) {
O1.getOutputString();
else {
break;
break;
case '3':
quit=true;
break;
case '\n':
case '\t':
break;
default:
cout<<"Wrong Choice";
quit=false;
break;
return 0;
OUTPUT
CONCLUSION
BIBLIOGRAPHY
Websites:
https://sites.google.com
http://www.wikipedia.org
http://www.umsl.edu
http://grid.cs.gsu.edu
Books referred: