You are on page 1of 21

ABSTRACT

Cryptography prior to the modern age was effectively synonymous with


encryption, the conversion of information from a readable state to apparent
nonsense. The originator of an encrypted message shared the decoding
technique needed to recover the original information only with intended
recipients, thereby precluding unwanted persons from doing the same.

Modern cryptography is heavily based on mathematical theory and


computer science practice; cryptographic algorithms are designed around
computational hardness assumptions, making such algorithms hard to break in
practice by any adversary. It is theoretically possible to break such a system,
but it is infeasible to do so by any known practical means.

The growth of cryptographic technology has raised a number of legal


issues in the information age. Cryptography's potential for use as a tool for
espionage and sedition has led many governments to classify it as a weapon
and to limit or even prohibit its use and export. In some jurisdictions where the
use of cryptography is legal, laws permit investigators to compel the disclosure
of encryption keys for documents relevant to an investigation. Cryptography
also plays a major role in digital rights management and copyright infringement
of digital media.
MODULE DESCRIPTION

The following functions given below (except main()) belongs to the


class “encryptiondecryption” and all are used to manipulate the data members
of the given class

void doEncryption():

This is the member function of class encryptiondecryption it does the


main process in this program it does the process of encryption by following a
key and swap on loop.

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):

This is the overloaded form of the above constructor which is used to


assign the value of the input string to the data member “inputstring”.

void setEncPass(string):

It is used to assign the password for the encryption and decryption


which is got in runtime and saves it in a file.
void setInputString(string):

This function is used to call the constructor


encrytiondecryption::encryptiondecrytion(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)

It is used to assign the password to the data member for encryption.

int checkDecPass(string):

It is used to check the password for decryption given by the user is


the correct one by comparing with the one in the file.

void getOutputString():

This function is used to return the encrypted data as well as


decrypted data.

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:

In the current system the cryptographic program is based on simple loop


based and simple method such as adding key to the plain text and it doesn’t
have a graphical interface for easy usage and gives a easy way to crack even
with the brute force attack.

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:

It can be more complicated algorithm by based on RES, DES, Blow Fish.


And it can be proposed to be a graphical interface which make it more easy for
novice users too and may need to involve the key more in encrypting plain text
than involved now.
SYSTEM SPECIFICATION

HARDWARE SPECIFICATION :

Hard Disk : 500GB

RAM : 4GB.

Processor : Intel Core i3-4005U

VDU : 1366x768p

SOFTWARE SPECIFICATION:

Operating System : Windows 7 pro

Architecture : x64

Compiler : Code::Blocks 17.12


ABOUT THE SOFTWARE

Code::Blocks is a free, open-source cross-platform IDE that supports multiple


compilers including GCC, Clang and Visual C++. It is developed in C++ using
wxWidgets as the GUI toolkit. Using a plugin architecture, its capabilities and
features are defined by the provided plugins. Currently, Code::Blocks is
oriented towards C, C++, and Fortran. It has a custom build system and optional
Make support.

Compilers

Code::Blocks supports multiple compilers, including GCC, MinGW, Digital Mars,


Microsoft Visual C++, Borland C++, LLVM Clang, Watcom, LCC and the Intel C++
compiler. Although the IDE was designed for the C++ language, there is some
support for other languages, including Fortran and D. A plug-in system is
included to support other programming languages.

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

As of version 13.12 Code::Blocks comes with a GUI designer called wxSmith. It


is a derivative port of wxWidgets version 2.9.4. To make a complete wxWidgets
application, the appropriate wxWidgets SDK must be installed.

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.

Project files and build system

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>

using namespace std;

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];

temp = temp + enckey;

tempc = (char)temp;

outputstring += tempc;

void EncryptionDecryption::doDecryption() {

for(int i=0;i<inputstring.size();i++) {

temp = (int)inputstring[i];

temp = temp + deckey;

tempc = (char)temp;

outputstring += tempc;

void EncryptionDecryption::getOutputString() {
outputstring += '\0';

cout << "The Encrypted/Decrypted string is" <<" : "<<outputstring;

outputstring="";

int EncryptionDecryption::checkEncPass(string pass) {

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;

void EncryptionDecryption::setEncPass(string pass)

fstream fio("keyfile.txt",ios::out);

encpass=pass;

fio<<pass;

int EncryptionDecryption::checkDecPass(string 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;

cout << "\n******************************************";

cout << "\nMenu\n";

cout << "1. Encryption\n";

cout << "2. Decryption\n";

cout << "3. Quit\n";

cout << "******************************************";

while(!quit)

quit = false;
cout << "\nEnter the choice to perform the task";

cout << "\nEnter 1 or 2 or 3: ";

cin >> ch;

switch(ch)

case '1':

cout << "Enter word to Encrypt: ";

cin.ignore();

getline(cin, inputstring);

O1.setInputString(inputstring);

cout << "Enter the password to set Encryption: ";

getline(cin, pass);

O1.setEncPass(pass);

if(O1.checkEncPass(pass)==1) {

O1.getOutputString();

else {

break;

break;

case '2':

cout << "Enter word to Decrypt: ";

cin.ignore();

getline(cin, inputstring);
O1.setInputString(inputstring);

cout << "Enter the password to proceed Decryption: ";

getline(cin, pass);

if(O1.checkDecPass(pass)==1) {

O1.getOutputString();

else {

break;

break;

case '3':

cout<< "Exiting the program";

quit=true;

break;

case '\n':

case '\t':

case ' ':

break;

default:

cout<<"Wrong Choice";

quit=false;

break;

cout << "\n\n";


}

return 0;

OUTPUT

Displaying Main Menu:


Choosing encryption get a encrypted data:

Decryption for the encrypted data:


Checking the decryption with wrong password:

Trying encryption with other string:

Trying decryption for the encrypted :


Exiting from the application:

CONCLUSION

As we toward a society where automated information resources are


increased and cryptography will continue to increase in importance
as a security mechanism. Electronic networks for banking,
shopping, inventory control, benefit and service delivery, information
storage and retrieval, distributed processing, and government
applications will need improved methods for access control and
data security.
The information security can be easily achieved by using
Cryptography technique. DES is now considered to be insecure for
some applications like banking system.
there are also some analytical results which demonstrate theoretical
weaknesses in the cipher.
So it becomes very important to augment this algorithm by adding
new levels of security to make it applicable.
By adding additional key, modified S-Box design, modifies function
implementation and replacing the old XOR by a new operation as
proposed by this thesis to give more robustness to DES algorithm
and make it stronger against any kind of intruding.
DES Encryption with two keys instead of one key already will
increase the efficiency of cryptography.

BIBLIOGRAPHY

Websites:
 https://sites.google.com
 http://www.wikipedia.org
 http://www.umsl.edu
 http://grid.cs.gsu.edu

Books referred:

 Computer fundamentals programming methodology programming in c++ 8th Edition

Author: Sumitha Arora

You might also like