Vous êtes sur la page 1sur 59

Hydra-Cryptor

1. Abstract and Synopsis

Abstract

The main objective of this project is to provide various encryption and decryption techniques
to the user. The system also provides Morse code translation. It is concerned with embedding
information in a secure and robust manner.

This allows the user to choose whether or not the end user want to encrypt the data
and the type of algorithm to use for encryption. It also allows the user to convert text to
Morse code so it can be transmitted easily. Making use of the encryption and decryption
techniques one can imply methods of secure communication in the presence of third party.
The project basically allows a dynamic and robust means of encryption and decryption of the
message allowing the user to select from various types of these methods.

BVIMIT 1
Hydra-Cryptor

Synopsis

Encryption and Decryption:

It is the process of converting ordinary information (called plaintext) into unintelligible text
(called cipher text). Decryption is the reverse, in other words, moving from the unintelligible
cipher text back to plaintext. A cipher is a pair of algorithms that create the encryption and
the reversing decryption. The detailed operation of a cipher is controlled both by the
algorithm and in each instance by a "key". This is a secret (ideally known only to the
communicants), usually a short string of characters, which is needed to decrypt the cipher text

Encryption is the most effective way to achieve data security. The process of Encryption
hides the contents of a message in a way that the original information is recovered only
through a decryption process

The purpose of Encryption is to prevent unauthorized parties from viewing or modifying the
data. Encryption occurs when the data is passed through some substitute technique, shifting
technique, table references or mathematical operations.

Key-based algorithms:
use an Encryption key to encrypt the message. There are two general categories for key-based
Encryption:

i)Symmetric Encryption
which uses a single key to encrypt and decrypt the message

ii)Asymmetric Encryption:
which uses two different keys – a public key to encrypt the message, and a private key to
decrypt it. Currently, there are several types of key based Encryption algorithms such as:
DES, RSA, PGP, Elliptic curve, and others but all of these algorithms depend on high
mathematical manipulations.

Morse Code:

Morse code is a method of transmitting text information as a series of on-off tones,


lights, or clicks that can be directly understood by a skilled listener or observer without
special equipment. The International Morse Code encodes the ISO basic Latin alphabet, some
extra Latin letters, the Arabic numerals and a small set of punctuation and procedural signals
(pro-signs) as standardized sequences of short and long signals called "dots" and "dashes", or
"dits" and "dahs", as in amateur radio practice.

Straight keys where the machines that were used at the world war time to encode the
message into Morse code and also to decode them as the set of code with dot and dashes

BVIMIT 2
Hydra-Cryptor

where already defined and are universal. The length of the dashes could depend upon the
specific encoder,

Objective

The Objective of the project is to provide security to the communicating parties


between a third party, by providing different types of encryption and decryption techniques to
the user.

The main goal is to deliver a platform with basic message encryption and decryption
techniques, the project only implies with the symmetric type of text encryption. And also
consist the Morse code message passing which involves (DOT & DASHES), in which we
only use this two characters to encrypt the message with pre-defined set of code assigned to
each and every alphabet.

As compared to the traditional techniques the system would be less time consuming, efficient
and very convenient to use which involves very less paper work and eliminates all the third
party because of which there is rise in the chances of data or message ambiguity.

BVIMIT 3
Hydra-Cryptor

2. Business Case
2.1 Introduction

The main objective of this project is to provide various encryption and decryption
techniques to the user. The system also provides Morse code translation. It is concerned with
embedding information in a secure and robust manner.

This allows the user to choose whether or not they want to encrypt the data and the
type of algorithm to use for encryption. It also allows the user to convert text to Morse code
so it can be transmitted easily. Making use of the encryption and decryption techniques one
can imply methods of secure communication in the presence of third party. The project
basically allows a dynamic and robust means of encryption and decryption of the message
allowing the user to select from various types of these methods.

Encryption and Decryption:


It is the process of converting ordinary information (called plaintext) into unintelligible text
(called cipher text). Decryption is the reverse, in other words, moving from the unintelligible
cipher text back to plaintext. A cipher is a pair of algorithms that create the encryption and
the reversing decryption. The detailed operation of a cipher is controlled both by the
algorithm and in each instance by a "key". This is a secret (ideally known only to the
communicants), usually a short string of characters, which is needed to decrypt the cipher text

Encryption is the most effective way to achieve data security. The process of Encryption
hides the contents of a message in a way that the original information is recovered only
through a decryption process

The purpose of Encryption is to prevent unauthorized parties from viewing or modifying the
data. Encryption occurs when the data is passed through some substitute technique, shifting
technique, table references or mathematical operations.

2.2 Problem definition

User need more convenient way to get their required results in proper time. In today’s era
where technology plays a vital role in each person's life, they are bound to use the old
fashioned manual techniques to implement the message passing methods, which are not at all
safe secure and convenient.
The traditional techniques of message encryption involved a lot of paper work which was
very time consuming and was having no security to the message. The involvement of third

BVIMIT 4
Hydra-Cryptor

party or many unnecessary users increase the chances of data/message ambiguity and
redundancy.
Morse code traditionally where made with the help of straight key with is very stressful and
time taking criteria. Hence it is required to deliver something convenient, reliable, and has no
paper work and provides security and the safety to the both message and the sender and also
at the receiving end.
Hence to tackle the above problems there is need to develop a system that is more powerful
efficient and convenient to the user.

Current problem:
According to the current progress of the project the module wise coding is
been done and they are being unit tested individually to check whether they are functional
acquiring the results positive, each individual modules are functional individually as of now
with respect to the current progress.
But there might be situation where the system may not function correctly when they are being
integrated together and been tested. As there are different encryption techniques hence it
becomes important to avail the user with different choices from which the end user has to
make the decision of selecting one.
There might be problem with the Input/output operations which would affect both the
encryption and the decryption process.
With respect to the current progress of the project there are above expected problems that
might occur.

2.3 Measurable Organizational value (MOV)

2.3.1 Time Frame


Space of seconds, minutes, hours, days, weeks, months or years with an established
beginning date and ending date. It's a unit of measurement used to categorize a length of
time. Also called timeframe.
A time frame is duration or period in which certain task, objectives or events are scheduled to
occur been specified to complete a specific task or in other words to achieve a certain
objective.

Accurate time estimation is a skill essential for good project management. It is


important to get time estimates right for two main reasons:

BVIMIT 5
Hydra-Cryptor

1. Time estimates drive the setting of deadlines for delivery and planning of projects,
and hence will impact on other people’s assessment of your reliability and competence as a
project manager.
2. Time estimates often determine the pricing of contracts and hence the profitability
of the contract/project in commercial terms.

Time frame for Hydra-Cryptor


As the project is a curriculum project hence it is mandatory to deliver the system in
time with all its deliverables as expected by the stake holders.
Hence the Base Line scheduled for the project is around 60 days with the following start and
end dates.

Start Date : 22nd August 2016 (Monday)


End Date : 11th November 2016 (Friday)

2.3.2 Stake Holders


As the project is a curriculum project developed under the respective subjects of
Objected oriented programming(OOP) and Software engineering project
management(SEPM), hence the stake holder for the system that are the Mentors.

Mentor:
A person who gives a younger or less experienced person help and advice over a
period of time, especially at work or school. The stakeholders for the system are both the
mentors of the respective subjects.
As mentioned above the project is all about secure communication medium and to tackle the
various issues uncovered in the traditional system and provide the end user with best
experience and make essential use of technology.
Mentors under the agreement of whom the respective project was verified and brought into
development.

BVIMIT 6
Hydra-Cryptor

2.3.3 Scope

The future of encryption is brighter than ever before. The demand for more control
and protection of corporation information assets and third-party information is increasing
dramatically. The amount of information being communicated and stored electronically is
vastly greater than even five years ago. As a result, the need for more effective information
security products is growing at a higher rate than any other aspect of IT technology within the
enterprise today. The Internet and the mobility of its users have removed the perimeters of
communication. Encryption is the last line of defence for the modern day enterprise.

There are seven critical market drivers that will shape the future of encryption and the
applications that embodied it:
• Email privacy and regulatory requirements
• Increasing compromises and unauthorized access to critical business information
• The expanding enterprise
• User mobility
• Communications appliances
• Increased enterprise control vs. third-party supply of messaging and storage solutions
• The art of storing and retrieving corporate information assets

A recent independent survey conducted by industry analyst firm Aberdeen Group shows an
increasing use of encryption and a growing need for centralized and automated key
management.
Eighty-one percent of respondents had increased the number of applications using encryption,
50 percent had increased the number of locations implementing encryption and 71 percent
had increased the number of encryption keys under management compared with one year
ago.

Conclusion:
At the end of the day we need to protect our data. Increasingly, encryption is being
seen as the best way to ensure that data is protected, but the ever growing use of encryption
creates a management challenge.
The challenge, however, doesn’t need to be daunting. Implementing a flexible and extensible
solution that automates many of the time-consuming and error-prone key management tasks

BVIMIT 7
Hydra-Cryptor

in an automated enterprise-wide manner is rapidly becoming a priority for many


organizations.
In order for enterprise-wide encryption to be deployed correctly, organizations need to deploy
the correct tool to manage the keys. In the same way that data protection has moved from an
IT challenge to a C-level issue, key management has become a high-level business
imperative.

BVIMIT 8
Hydra-Cryptor

2.3.4 Alternatives for Solution:

Solution 1:
According to the current problem if for some reasons the system won’t function when
they modules are been integrated together then the alternative could be used so as to keep all
the modules separate and then integrate them by using another module, by including each and
every module in a new file/module with the help of the header files.
Which would make the task much easier but would increase the handling of the input/output
operations and manipulation. Hence by including each module separately would remove the
problem in the current system of accepting the Input’s from the end user.

Solution 2:
As a second alternative to make all the modules functional the last option would be to
enhance the program with making chances in the code and the interface sections and making
the program more basic and simple rather than complicating the modules.
Which would ultimately remove the conflicts between the modules when they are integrated
together.

2.3.5 Feasibility study:


As the name implies, a feasibility study is an analysis of the viability of an idea. The
feasibility study focuses on helping answer the essential question of “should we proceed with
the proposed project idea?” All activities of the study are directed toward helping answer this
question.
it is not the purpose of the feasibility study or the role of the consultant to decide whether or
not to proceed with a business idea. It is the role of the project leaders to make this decision,
using information from the feasibility study and input from consultants.

 Technical feasibility:
 Hydra-cryptor is able to handle all the strings number and character
type of values. The end user is able to encrypt decrypt them with given
techniques.
 With the addition of the Morse code module the user is now also able
to encrypt the message into Morse code and again decrypt it into a
normal plain text to retrieve the original message.
 No other existing system provide options with both the encryption and
Morse modules, hence the system is more feasible than other existing.
 There is no additional Hardware required for the project as it may run
on the requirements specified and also with the current system.

BVIMIT 9
Hydra-Cryptor

 As the system is developed as a curriculum project there is no need for


any financial considerations for any type of technical enhancement’s.

 Behavioural feasibility:

 As the system is totally computerized as compared to the traditional


systems hence the reactions would be likely in the favour of
development of the system.
 As the system is capable of delivering a handful of requirements and
needs in accordance with the growing technology and demanding
security, and is capable of accomplishing the drawbacks encountered
in the traditional system hence the End user staffs are likely to support
the development of the computerized system.

2.3.6 Declaration of MOV:

The project entitled “Hydra-Cryptor” would be very successful as per the growing
demands for the security and ambiguity issues in the confidential information. Hence the
project is Declared with the above specified Modules and Objectives.

BVIMIT 10
Hydra-Cryptor

3. Project Charter

3.1 Project Stakeholders

 Prof. Smita kapse


Project Co-ordinator
(Bharati vidyapeeth Institute of Management and Information Technology)

 Prof. Divya premchandran


Project Co-ordinator
(Bharati vidyapeeth Institute of Management and Information Technology)

 Mr. Mohammedhussain Bharmal


Project Developer
MCA FY SEM-I (Roll no-03)
mohammedbharmal3695@gmail.com
(Bharati vidyapeeth Institute of Management and Information Technology)

 Mr. Hari Narayan Singh


Project Developer
MCA FY SEM-I (Roll no-34)
harry.111singh@gmail.com
(Bharati vidyapeeth Institute of Management and Information Technology)

BVIMIT 11
Hydra-Cryptor

3.2 Project Background

Encryption and Decryption:

It is the process of converting ordinary information (called plaintext) into unintelligible text
(called cipher text). Decryption is the reverse, in other words, moving from the unintelligible
cipher text back to plaintext. A cipher is a pair of algorithms that create the encryption and
the reversing decryption. The detailed operation of a cipher is controlled both by the
algorithm and in each instance by a "key". This is a secret (ideally known only to the
communicants), usually a short string of characters, which is needed to decrypt the cipher text

Encryption is the most effective way to achieve data security. The process of Encryption
hides the contents of a message in a way that the original information is recovered only
through a decryption process

The purpose of Encryption is to prevent unauthorized parties from viewing or modifying the
data. Encryption occurs when the data is passed through some substitute technique, shifting
technique, table references or mathematical operations.

3.3 Measurable Organizational Value (MOV)

3.3.1 Scope
The future of encryption is brighter than ever before. The demand for more control
and protection of corporation information assets and third-party information is increasing
dramatically. The amount of information being communicated and stored electronically is
vastly greater than even five years ago. As a result, the need for more effective information
security products is growing at a higher rate than any other aspect of IT technology within the
enterprise today. The Internet and the mobility of its users have removed the perimeters of
communication. Encryption is the last line of defence for the modern day enterprise.
There are seven critical market drivers that will shape the future of encryption and the
applications that embodied it:
• Email privacy and regulatory requirements
• Increasing compromises and unauthorized access to critical business information
• The expanding enterprise
• User mobility
• Communications appliances
• Increased enterprise control vs. third-party supply of messaging and storage solutions

BVIMIT 12
Hydra-Cryptor

A recent independent survey conducted by industry analyst firm Aberdeen Group shows an
increasing use of encryption and a growing need for centralized and automated key
management.
Eighty-one percent of respondents had increased the number of applications using encryption,
50 percent had increased the number of locations implementing encryption and 71 percent
had increased the number of encryption keys under management compared with one year
ago.

3.3.2 Project Scheduled Summary


A time frame is duration or period in which certain task, objectives or events are
scheduled to occur been specified to complete a specific task or in other words to achieve a
certain objective.
Accurate time estimation is a skill essential for good project management. It is
important to get time estimates right for two main reasons:
1. Time estimates drive the setting of deadlines for delivery and planning of projects,
and hence will impact on other people’s assessment of your reliability and competence as a
project manager.
2. Time estimates often determine the pricing of contracts and hence the profitability
of the contract/project in commercial terms.

Time frame for Hydra-Cryptor


As the project is a curriculum project hence it is mandatory to deliver the system in
time with all its deliverables as expected by the stake holders.
Hence the Base Line scheduled for the project is around 60 days with the following start and
end dates.

Start Date : 22nd August 2016 (Monday)


End Date : 11th November 2016 (Friday)

3.3.3 Declaration of MOV:


The project entitled “Hydra-Cryptor” would be very successful as per the growing
demands for the security and ambiguity issues in the confidential information. Hence the
project is Declared with the above specified Modules and Objectives.

BVIMIT 13
Hydra-Cryptor

BVIMIT 14
Hydra-Cryptor

BVIMIT 15
Hydra-Cryptor

BVIMIT 16
Hydra-Cryptor

4. Software Requirement Specification

Revision History

NAME DATE REASONS FOR CHANGE VERSION

Hari Narayan Singh 05/11/2016 New SRS document created (Initial 1


Mohammed Bharmal version)

BVIMIT 17
Hydra-Cryptor

4.1 Introduction

4.1.1 Purpose
The purpose of this document is to describe functionality and behaviour of the Hydra
cryptor. This document is intended to be viewed only by project advisor, the development
team members and all the stake holders.
This document provides all of the requirements for the system and are intended primarily
for customers of the application, but will also be of interest to all the other stake holders. The
document will also be of interest to customers.The purpose of this project is to demonstrate
how some of the more popular encrypting algorithms work their “magic”. The system will
allow the user to enter a message, select an encryption method, and then view the message
encrypted by the selected algorithm. When an encryption method is selected, options
pertaining to that specific algorithm will be displayed. Algorithm will then begin encrypting
the message.

4.1.2 Scope
The scope of this project is limited to factors incorporated by the program itself. In the
future, additional components may be added.
This document covers the requirements for release 0.1 of Cryptic. Mention will be
madethroughout this document of selected probable features of future releases. The purpose
of thisis to guide developers in selecting a design that will be able to accommodate the full-
scale application.

4.1.3 Definition, Acronyms, and Abbreviations

Caesar Cipher - A cipher in which each letter is translated to the letter a fixed number of
letters after it in the alphabet.

Vigenère cipher- The Vigenère cipher is a method of encrypting alphabetic text by using a
series of different Caesar ciphers based on the letters of a keyword. It is a simple form of
polyalphabetic substitution.
Atbash Cipher- The Atbash cipher is a substitution cipher with a specific key where the
letters of the alphabet are reversed. I.e. all 'A's are replaced with 'Z's, all 'B's are replaced with
'Y's, and so on. It was originally used for the Hebrew alphabet, but can be used for any
alphabet.

BVIMIT 18
Hydra-Cryptor

4.2 Overall Description

4.2.1 Software Interface


As the software is a university project there is no database or other software’s been used
or integrated in the system as of now.
Hydra cryptor is intended to be operating system independent. Therefore no specific
operating system is excluded.The system is intended to interface with a single user at any
given time. The user is able to interact with the system using a user interface.

4.2.2 Hardware Interface


Cryptic is intended to be platform independent. Therefore, no specific hardware is
excluded. But it will at least work on x64 systems without any additional porting efforts.
Moreover, no special hardware is needed for software operation.

4.2.3 Operating Environment


Operating Environment Cryptic is intended to be operating system independent.
Therefore, no specific operating system is excluded. But it will run on
Window/Linux/Unix/BSD distributions etc. Cryptic is intended to be platform independent.
Therefore, no specific hardware is excluded. But it will at least work on x86 systems without
any additional porting efforts. Moreover, no special hardware needed for software operation.

4.2.4 Design and Implementation constraints


Hardware Required
Processor : Pentium p4
RAM : 128MB
Hard Disc : 100MB

Software Required
Operating system : Windows, Linux
Developing Tool : Turbo C, G++

BVIMIT 19
Hydra-Cryptor

4.3 Functional Requirements


4.3.1 Cryptographic function: Encryption
▪ Description and Priority
This system feature involves encrypting the data using one of many symmetric or
asymmetric cryptographic ciphers for data security.
Priority: High
▪ Stimulus/Response Sequences
o User selects the cipher to encrypt data.
o User selects enters the data/message to be encrypted.
o User confirms encryption to be performed by program.
▪ Functional requirements
1. User selects the cipher method to be used to encrypt data.
2 User selects enters the data/message to be encrypted.
3. User now confirms to obtain the encrypted text.
4. Output the encrypted text is now been generated and displayed to user.

4.3.2 Cryptographic function: Decryption


▪ Description and Priority
This system feature involves decrypting the data using one of many symmetric or
asymmetric cryptographic ciphers for data security.
Priority: High
▪ Stimulus/Response Sequences
o User selects the cipher used to decrypt data.
o User selects data to be decrypted
o User confirms decryption to be performed by program.
▪ Functional requirements
1. User selects the cipher method with which the data was encrypted.
2. User the encrypted data that is to be decrypted.
2. User now confirms to obtain the decrypted text (original message).
3. Output The original message is been obtained and displayed to the user.

BVIMIT 20
Hydra-Cryptor

4.3.3 System model

RAD Model

Rapid Application Development model is to used to develop project in less time. This
provide system’s prototype, which can be shown to the users for their understanding. And
better understanding for the developer as the customer is not aware of the technical term.
Whenever there is any change the developer has to follow the same process again.

Description and Priority:


This system feature involves the contact details to be stored in a Phonebook Directory.
Priority: High

BVIMIT 21
Hydra-Cryptor

4.4 Non-Functional Requirements

4.4.1 Performance Requirements


Most public key ciphers rely on high computational cost operations. Therefore, keeping
performance considerations in mind, in most cases symmetric key ciphers are recommended
for data encryption/decryption (unless the user is willing to spend very large amount of
computational effort to encryption/decryption using public key cipher). Public key ciphers are
recommended to be used only in situations such as authentication or to confidentially
distribute symmetric keys.

4.4.2 Safety Requirements


As the system is a university project it’s meant to be a prototype and work without any
harm.
The user is still required to obtain relevant information in encryption/decryption algorithm’s
to be able to use the system at its fullest.

4.4.3 Security Requirements


This software package uses strong cryptography, so even if it is created, maintained and
distributed from liberal countries (where it is legal to do this), it falls under certain
export/import and/or use restrictions in some other parts of the world.
Please remember that export/import and/or use of strong cryptography software,
providing cryptography hooks or even just communicating technical details about
cryptography software is illegal in some parts of the world. So, when you import this package
to your country, re-distribute it from there or even just email technical suggestions or even
source patches to the author or other people you are strongly advised to pay close attention to
any export/import and/or use laws which apply to you.
There is no additional security measure required for the software.

4.4.4 Software Quality Attributes

Adaptability and reusability: The suite is simple (and intuitive) enough that it should not be
difficult to adapt it to user’s needs. The code is standards compliant and is therefore easily
reusable in other applications.
• Availability: The complete code Hydra cryptor can be easily extracted.

BVIMIT 22
Hydra-Cryptor

• Portability: The code is done in C++ with basic functionality, it should be easily portable
to different architectures and operating systems.
• Reliability: Serious attempts are made to make sure code is reliable and of enterprise
quality. Still, the code is reliable and functional enough to perform the basic specified
functionality.
• Usability: The project is still in planning stage as of SRS version-1, but when the
development starts, the code is not expected to be usable at least until all the modules are
been developed separately.

BVIMIT 23
Hydra-Cryptor

5. System Designing

Use Case Diagram.


Hydra-Cryptor

Example of the system working:

BVIMIT 24
Hydra-Cryptor

6. Code

#include <iostream>
#include <string>
#include <cstring>
#include <sstream>
using namespace std;
class morse
{
char morse1[43] =
{'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','
p','q','r','s','t','u','v','w','x','y','z','0','1','2','3','4'
,'5','6','7','8','9','.',',','?','!',':','"','='};
char morse1_cap[43] =
{'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','
P','Q','R','S','T','U','V','W','X','Y','Z','0','1','2','3','4'
,'5','6','7','8','9','.',',','?','!',':','"','='};
string morse2[43] = {".-","-...","-.-.","-..",".","..-
.","--.","....","..",".---","-.-",".-..","--","-.","---",".--
.","--.-",".-.","...","-","..-","...-",".--","-..-","-.--","--
..","-----",".----","..---","...--","....-",".....","-....","-
-...","---..","----.",".-.-.-","--..--","..--..","..--.","---
...",".-..-.","-...-"};
string input,input_lower,*input_str;
char *input1;
int i,j;
public:
void input_char()
{
cout<<"Enter the text to be converted: ";
getline(cin,input);
input1 = new char[input.size()+1];
input1 = strcpy(input1,input.c_str());
}

BVIMIT 25
Hydra-Cryptor

void input_string()
{
cout<<"Enter the code to be converted: ";
getline(cin,input);
input_str = new string[input.size()+1];
i=0;
stringstream ssin(input);
while (ssin.good() && i < input.size())
{
ssin >> input_str[i];
++i;
}
}
void encode()
{
int len=input.size();
for(i=0; i<len; i++)
{
int counter = 0;
for(j=0;j<43;j++)
{
if (input1[i] == morse1[j] || input1[i] ==
morse1_cap[j])
{
counter++;
cout<<morse2[j]<<" ";
break;
}
}
if (input1[i]== ' ')
{

BVIMIT 26
Hydra-Cryptor

cout<<"/ ";
}
if(input1[i] != ' ' && counter == 0)
cout<<"# ";
}
cout<<endl;
}
void decode()
{
int len=input.size();
for(i=0; i<len; i++)
{
for(j=0; j<43; j++)
{
if(input_str[i] == morse2[j])
{
cout<<morse1[j];
break;
}
}
if(input_str[i] == "/")
{
cout<<" ";
}
}
cout<<endl;
}
};
class atbash
{

BVIMIT 27
Hydra-Cryptor

string input;
int i,j,len;
char arr[26],arr_c[26],arr_reverse[26],arr_reverse_c[26];
char arr1[10] =
{'0','1','2','3','4','5','6','7','8','9'};
char arr1_reverse[10] =
{'9','8','7','6','5','4','3','2','1','0'};
char *input_arr;
public:
void array()
{
len=input.size();
char a = 'a';
for(i=0; i<26; i++)
{
arr[i]=a;
a++;
}
a = 'z';
for(i=0;i<26;i++)
{
arr_reverse[i]=a;
a--;
}
a = 'A';
for(i=0; i<26; i++)
{
arr_c[i]=a;
a++;
}
a = 'Z';

BVIMIT 28
Hydra-Cryptor

for(i=0;i<26;i++)
{
arr_reverse_c[i]=a;
a--;
}
}
void input_encrypt_atbash()
{
cout<<"Enter the text to be encrypted: ";
getline(cin,input);
input_arr = new char[input.size()+1];
input_arr = strcpy(input_arr,input.c_str());
cout<<endl;
}
void input_decrypt_atbash()
{
cout<<"Enter the cipher to be decrypted: ";
getline(cin,input);
input_arr = new char[input.size()+1];
input_arr = strcpy(input_arr,input.c_str());
cout<<endl;
}
void encrypt_atbash()
{
int x = 0;
array();
for(i=0;i<len;i++)
{
x = 0;
for(j=0;j<26;j++)

BVIMIT 29
Hydra-Cryptor

if(input_arr[i] == arr[j])
{
x = 1;
cout<<arr_reverse[j];
break;
}
for(j=0;j<26;j++)
if(input_arr[i] == arr_c[j])
{
x = 1;
cout<<arr_reverse_c[j];
break;
}
if(input_arr[i] == ' ')
{
x = 1;
cout<<" ";
}
for(j=0;j<10;j++)
if(input_arr[i] == arr1[j])
{
x = 1;
cout<<arr1_reverse[j];
break;
}
if(x == 0)
cout<<input_arr[i];
}
cout<<endl;
}

BVIMIT 30
Hydra-Cryptor

};
class ceaser
{
string input,input1;
char arr[26],arr_c[26],*input_arr;
char arr1[10] =
{'0','1','2','3','4','5','6','7','8','9'};
int i,j,len;
public:
void array()
{
len=input.size();
char a = 'a';
for(i=0; i<26; i++)
{
arr[i]=a;
a++;
}
a = 'A';
for(i=0; i<26; i++)
{
arr_c[i]=a;
a++;
}
}
void input_encrypt_ceaser()
{
cout<<"Enter the text to be encrypted: ";
getline(cin,input);
input_arr = new char[input.size()+1];
input_arr = strcpy(input_arr,input.c_str());

BVIMIT 31
Hydra-Cryptor

cout<<endl;
}
void input_decrypt_ceaser()
{
cout<<"Enter the cipher to be decrypted: ";
getline(cin,input);
input_arr = new char[input.size()+1];
input_arr = strcpy(input_arr,input.c_str());
cout<<endl;
}
void encrypt_ceaser()
{
int x;
array();
for(i=0;i<len;i++)
{
x = 0;
for(j=0;j<26;j++)
if(input_arr[i] == arr[j])
{
if(j+13 > 25)
{
int x = j-13;
cout<<arr[x];
}
else
cout<<arr[j+13];
x = 1;
}
for(j=0;j<26;j++)

BVIMIT 32
Hydra-Cryptor

if(input_arr[i] == arr_c[j])
{
if(j+13 > 25)
{
int x = j-13;
cout<<arr_c[x];
}
else
cout<<arr_c[j+13];
x = 1;
}
if (input_arr[i] == ' ')
{
cout<<" ";
x = 1;
}
for(j=0;j<10;j++)
if(input_arr[i] == arr1[j])
{
if(j+3 > 9)
{
int x = j-7;
cout<<arr1[x];
}
else
cout<<arr1[j+3];
x = 1;
}
if (x == 0)
cout<<input_arr[i];

BVIMIT 33
Hydra-Cryptor

}
cout<<endl;
}
void decrypt_ceaser()
{
int x;
array();
for(i=0;i<len;i++)
{
x = 0;
for(j=0;j<26;j++)
if(input_arr[i] == arr[j])
{
if(j+13 > 25)
{
int x = j-13;
cout<<arr[x];
}
else
cout<<arr[j+13];
x = 1;
}
for(j=0;j<26;j++)
if(input_arr[i] == arr_c[j])
{
if(j+13 > 25)
{
int x = j-13;
cout<<arr_c[x];
}

BVIMIT 34
Hydra-Cryptor

else
cout<<arr_c[j+13];
x = 1;
}
if (input_arr[i] == ' ')
{
cout<<" ";
x = 1;
}
for(j=0;j<10;j++)
if(input_arr[i] == arr1[j])
{
if(j-3 < 0)
{
int x = j+7;
cout<<arr1[x];
}
else
cout<<arr1[j-3];
x = 1;
}
if (x == 0)
cout<<input_arr[i];
}
cout<<endl;
}
};
class vignere
{
string input,key;

BVIMIT 35
Hydra-Cryptor

int i,j,len,counter;
char *key_arr,*input_arr;
int *input_arr1,*key_arr1;
char arr[26],arr_c[26];
int arr1[10] = {'0','1','2','3','4','5','6','7','8','9'};
public:
void input_encrypt_vignere()
{
cout<<"Enter the text to be encrypted: ";
getline(cin,input);
cout<<"Enter the key: ";
getline(cin,key);
input_arr = new char[input.size()+1];
input_arr = strcpy(input_arr,input.c_str());
input_arr1 = new int[input.size()+1];
key_arr = new char[key.size()+1];
key_arr = strcpy(key_arr,key.c_str());
key_arr1 = new int[key.size()+1];
check_encrypt();
cout<<endl;
}
void input_decrypt_vignere()
{
cout<<"Enter the cipher to be decrypted: ";
getline(cin,input);
cout<<"Enter the key: ";
getline(cin,key);
input_arr = new char[input.size()+1];
input_arr = strcpy(input_arr,input.c_str());
input_arr1 = new int[input.size()+1];

BVIMIT 36
Hydra-Cryptor

key_arr = new char[key.size()+1];


key_arr = strcpy(key_arr,key.c_str());
key_arr1 = new int[key.size()+1];
check_decrypt();
cout<<endl;
}
void check_encrypt()
{
for(i=0; i<input.size(); i++)
if(input_arr[i] == ' ')
counter++;
if(key.size() > (input.size()-counter))
{
cout<<"Error: The key size should be less than
or equal to the text"<<endl;
input_encrypt_vignere();
}
else
for(i=0; i<key.size(); i++)
if(key_arr[i] == ' ')
{
cout<<"Error: The key should not
contain blank spaces"<<endl;
input_encrypt_vignere();
break;
}
}
void check_decrypt()
{
for(i=0; i<input.size(); i++)
if(input_arr[i] == ' ')

BVIMIT 37
Hydra-Cryptor

counter++;
if(key.size() > (input.size()-counter))
{
cout<<"Error: The key size should be less than
or equal to the cipher"<<endl;
input_decrypt_vignere();
}
else
for(i=0; i<key.size(); i++)
if(key_arr[i] == ' ')
{
cout<<"Error: The key should not
contain blank spaces"<<endl;
input_decrypt_vignere();
break;
}
}
void array()
{
len=key.size();
char a = 'a';
for(i=0; i<26; i++)
{
arr[i]=a;
a++;
}
a = 'A';
for(i=0; i<26; i++)
{
arr_c[i]=a;
a++;

BVIMIT 38
Hydra-Cryptor

}
}
void calc_key()
{
array();
counter = 0;
for(i=0; i<len; i++)
for(j=1; j<=26; j++)
if(key_arr[i] == arr[j-1])
{
key_arr1[i] = j;
break;
}
for(i=0; i<input.size(); i++)
{
for(j=1; j<=26; j++)
{
if(input_arr[i] == ' ')
input_arr1[i] = -1;
if(input_arr[i] == arr[j-1])
{
input_arr1[i] = j;
break;
}
}
for(j=1; j<=26; j++)
if(input_arr[i] == arr_c[j-1])
{
input_arr1[i] = j;
break;

BVIMIT 39
Hydra-Cryptor

}
for(j=0; j<10; j++)
if(input_arr[i] == arr1[j])
{
input_arr1[i] = j;
break;
}
}
}
void encrypt_vignere()
{
int x=0;
for(i=0; i<input.size(); i++)
{
if(input_arr[i] == ' ')
cout<<" ";
else
{
if(x == key.size())
x = 0;
if(input_arr[i] >='0' &&
input_arr[i]<='9')
{
int z = input_arr1[i]+key_arr1[x];
while (z >= 10)
z -= 10;
cout<<static_cast<char>(arr1[z]);
x++;
}
else if(input_arr[i] != ' ' &&
input_arr1[i] <= 0)

BVIMIT 40
Hydra-Cryptor

cout<<input_arr[i];
else
{
if(input_arr1[i]+key_arr1[x]>26)
{

cout<<static_cast<char>(input_arr[i]+key_arr1[x]-26);
x++;
}
else
{

cout<<static_cast<char>(input_arr[i]+key_arr1[x]);
x++;
}
}
}
}
cout<<endl;
}
void decrypt_vignere()
{
int x=0;
for(i=0; i<input.size(); i++)
{
if(input_arr[i] == ' ')
cout<<" ";
else
{
if(x == key.size())
x = 0;

BVIMIT 41
Hydra-Cryptor

if(input_arr[i] >='0' &&


input_arr[i]<='9')
{
int z = input_arr1[i]-key_arr1[x];
while (z < 0)
z += 10;
cout<<static_cast<char>(arr1[z]);
x++;
}
else if(input_arr[i] != ' ' &&
input_arr1[i] <= 0)
cout<<input_arr[i];
else
{
if(input_arr1[i]-key_arr1[x] <= 0)
{

cout<<static_cast<char>(input_arr[i]-key_arr1[x]+26);
x++;
}
else
{

cout<<static_cast<char>(input_arr[i]-key_arr1[x]);
x++;
}
}
}
}
cout<<endl;
}
};

BVIMIT 42
Hydra-Cryptor

int main()
{
int choice,m1,a1,c1,v1;
cout<<"1. Morse Code"<<endl;
cout<<"2. Atbash Cipher"<<endl;
cout<<"3. Ceaser's Cipher (ROT13)"<<endl;
cout<<"4. Vignere's Cipher"<<endl;
cout<<"Enter your choice: ";
cin>>choice;
cin.ignore();
switch(choice)
{
case 1:
{
cout<<"1. Convert to Morse code"<<endl;
cout<<"2. Convert from Morse code"<<endl;
cout<<"Enter your choice: ";
cin>>m1;
cin.ignore();
switch(m1)
{
case 1:
{
morse m;
m.input_char();
m.encode();
break;
}
case 2:
{

BVIMIT 43
Hydra-Cryptor

morse m;
m.input_string();
m.decode();
break;
}
default:
cout<<"Invalid choice"<<endl;
}
break;
}
case 2:
{
cout<<"1. Convert to cipher text"<<endl;
cout<<"2. Convert from cipher text"<<endl;
cout<<"Enter your choice: ";
cin>>a1;
cin.ignore();
switch(a1)
{
case 1:
{
atbash a;
a.input_encrypt_atbash();
a.encrypt_atbash();
break;
}
case 2:
{
atbash a;
a.input_decrypt_atbash();

BVIMIT 44
Hydra-Cryptor

a.encrypt_atbash();
break;
}
default:
cout<<"Invalid choice"<<endl;
}
break;
}
case 3:
{
cout<<"1. Convert to cipher text"<<endl;
cout<<"2. Convert from cipher text"<<endl;
cout<<"Enter your choice: ";
cin>>c1;
cin.ignore();
switch(c1)
{
case 1:
{
ceaser c;
c.input_encrypt_ceaser();
c.encrypt_ceaser();
break;
}
case 2:
{
ceaser c;
c.input_decrypt_ceaser();
c.decrypt_ceaser();
break;

BVIMIT 45
Hydra-Cryptor

}
default:
cout<<"Invalid choice"<<endl;
}
break;
}
case 4:
{
cout<<"1. Convert to cipher text"<<endl;
cout<<"2. Convert from cipher text"<<endl;
cout<<"Enter your choice: ";
cin>>v1;
cin.ignore();
switch(v1)
{
case 1:
{
vignere v;
v.input_encrypt_vignere();
v.calc_key();
v.encrypt_vignere();
break;
}
case 2:
{
vignere v;
v.input_decrypt_vignere();
v.calc_key();
v.decrypt_vignere();
break;

BVIMIT 46
Hydra-Cryptor

}
default:
cout<<"Invalid choice"<<endl;
}
break;
}
default:
cout<<"Invalid choice"<<endl;
}
return 0;
}

BVIMIT 47
Hydra-Cryptor

7.IMPLEMENTATION

Conversion of text to Morse code and vice versa for a single sentence.

BVIMIT 48
Hydra-Cryptor

Conversion of text to Atbash cipher and vice versa for a single sentence.

BVIMIT 49
Hydra-Cryptor

Conversion of text to Ceaser’s cipher and vice versa for a single sentence.

BVIMIT 50
Hydra-Cryptor

Conversion of text to Vignere’s cipher and vice versa for a single sentence with the key
‘example’.

BVIMIT 51
Hydra-Cryptor

Conversion of text to Vignere’s cipher and vice versa for a single sentence with the key ‘test’.

BVIMIT 52
Hydra-Cryptor

Conversion of text to Morse code and vice versa for a paragraph

BVIMIT 53
Hydra-Cryptor

Conversion of text to Atbash cipher and vice versa for a paragraph.

BVIMIT 54
Hydra-Cryptor

Conversion of text to Ceaser’s cipher and vice versa for a paragraph.

BVIMIT 55
Hydra-Cryptor

Conversion of text to Vignere’s cipher and vice versa for a single sentence with the key
‘encryption’.

BVIMIT 56
Hydra-Cryptor

Conversion of text to Vignere’s cipher and vice versa for a single sentence withthe key
‘cipher’.

BVIMIT 57
Hydra-Cryptor

8. Limitations and Future Enhancement


Limitations:

 A strongly encrypted, authentic, and digitally signed information can be difficult to


access even for a legitimate user at a crucial time of decision-making. The network
or the computer system can be attacked and rendered non-functional by an intruder.
 High availability, one of the fundamental aspects of information security, cannot be
ensured through the use of cryptography. Other methods are needed to guard against
the threats such as denial of service or complete breakdown of information system.
 Another fundamental need of information security of selective access control also
cannot be realized through the use of cryptography. Administrative controls and
procedures are required to be exercised for the same.
 Cryptography does not guard against the vulnerabilities and threats that emerge
from the poor design of systems, protocols, and procedures. These need to be fixed
through proper design and setting up of a defensive infrastructure.
 Cryptography comes at cost. The cost is in terms of time and money −
o Addition of cryptographic techniques in the information processing
leads to delay.
o The use of public key cryptography requires setting up and
maintenance of public key infrastructure requiring the handsome
financial budget.

Future Enhancement:

 More ciphers can be added in the future updates.


 The system can be made more user friendly by improving the menu-driven interface.
 The ciphers can be customized according to the user.

BVIMIT 58
Hydra-Cryptor

9. References

Bibliography:

 Programming in C by E.balgurusamy.
 Let us C by Yashwant Kanetakar.

Webliography:

 http://moluch.ru/archive/80/14319/
 https://en.wikipedia.org/wiki/Vigen%C3%A8re_cipher
 https://en.wikipedia.org/wiki/Atbash
 https://en.wikipedia.org/wiki/Caesar_cipher
 https://en.wikipedia.org/wiki/Morse_code

BVIMIT 59

Vous aimerez peut-être aussi