0% found this document useful (0 votes)
35 views59 pages

Screenshot 2024-05-20 at 5.35.42 PM

Uploaded by

rairaistar863
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
35 views59 pages

Screenshot 2024-05-20 at 5.35.42 PM

Uploaded by

rairaistar863
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 59

A

Mini Project Report


On

MESSAGE ENCRYPTION AND DECRYPTION USING


PYTHON
By
ZEBA YASMEEN
(1602-23-742-013)

Under the Guidance of

Ms.Madhumathi Jessu
(Assistant Professor, Department of Computer science engineering)

In partial fulfilment of the Requirements for the Degree of

MASTER IN TECHNOLOGY
in

DEPARTMENT OF COMPUTER SCIENCE


ENGINEERING
VASAVI COLLEGE OF ENGINEERING (Autonomous)
Accredited by NAAC with A++ Grade
(Affiliated to O.U & Approved by AICTE)
9-5-81, IBRAHIMBAGH, HYDERABAD-31, 500031.
BONAFIDE CERTIFICATE

This is to Certified that the project report titled “MESSAGE ENCRYPTION AND
DECRYPTION USING PYTHON” is the bonafide work of ZEBA
YASMEEN(1602-23-742-013) int the partial fulfilment of requirements for the
award degree of MASTER OF ENGINEERING IN COMPUTER SCIENCE
ENGINEERING, who carried out the project work under my supervision.
Certified further, that to the best of my knowledge the work reported herein does
not form part of any other thesis or dissertation on basis of which a degree or
award was conferred on an earlier occasion for this or any other candidate.

Ms.Madhumathi Jessu Dr.Adilakshmi


Internal GUIDE HEAD OF THE DEPARTMENT
Assistant Professor Department of C.S.E
Department of C.S.E

Signature of Internal Examiner Signature of External Examiner


ABSTRACT

Securing data encryption and decryption using Cryptography and Steganography


Techniques.Due to recent developments in stego analysis, providing security to personal
contents, messages, or digital images using steganography has become difficult.By using stego
analysis, one can easily reveal existence of hidden information in carrier files. This project
introduces a novel steganographic approach for communication between two private parties.
The approach introduced in this project makes use of both steganographic as well as
cryptographic techniques. In Cryptography we are using RSA.In Steganography we are using
Image Steganography for hiding the data. And we also use Mutual Authentication process to
satisfy all services in Cryptography i.e., Access Control, Confidentiality, Integrity,
Authentication. In this way we can maintain the data more securely.Since we use RSA
algorithm for securing the data and again on this we perform Steganography to hide the data in
an image. Such that any other person in the network cannot access the data present in the
network.Only the sender and receiver can retrieve the message from the data.
ACKNOWLEDGEMENT

With great pleasure we want to take this opportunity to express our heartfelt
gratitude to all people who helped in making this project work a great success

I am thankful to Ms.Madhumathi Jessu Assistant professor of C.S.E for being


moral support throughout the period of our study

I am grateful to the Ms.Madhumati Jessu mam for her valuable suggestions and
gratitude given by her during the execution of this project work

I would like to thank the teaching and non-teaching staff of dept. of. COMPUTER
SCIENCE ENGINEERING for sharing their knowledge with me.

ZEBA YASMEEN

1602-23-742-013
1
INDEX

CONTENTS PAGE NO.S

LIST OF FIGURES i
LIST OF TABLES i

ABSTRACT ii

CHAPTER : 1 INTRODUCTION 01-08

1.1 INTRODUCTION 01

1.2 HISTORY 02

1.3 OBJECTIVE 02

1.4 EXISTING SYSTEM 03-06

1.5 LITERATIVE REVIEW 07

1.6 PROPOSED SYSTEM 08

1.7 MOTIVATION 09

CHAPTER: 2 PROJECT DESCRIPTION


08-12

2.1 GENERAL 08

2.2 METHEDOLOGIES 09

2.2.1 MODULES USED 09

2.3 TECHNIQUE OR ALGORITHMS USED 10

2.3.1 EXISTING TECHNIQUE 10

2.3.2 PROPOSD TECHNIQUE 11-12

CHAPTER: 3 REQUIREMENTS ENGNEERING


13-14

3.1 GENERAL 13
3.2 HARDWARE REQUIREMENTS 13

3.3 SOFTWARE REQUIREMENTS 13

3.4 FUNCTINAL REQUIREMENTS 14

3.5 NON-FUNCTIONAL REQUIREMENTS 14

CHAPTER:4 DESIGN ENGINEERING


15-26

4.1 GENERAL 15

4.2 UML DIAGRAMS 16

4.2.1 USE CASE DIAGRAM 16

4.2.2 DATA FLOW DIAGRAM 17

4.2.3 CLASS DIAGRAM 18

4.2.4 SEQUENCE DIAGRAM 19

4.2.5 STATE DIAGRAM 20-22

4.3 SYSTEM ARCHITECTURE 23

CHAPTER: 5

5 DEVELOPMENT TOOLS 24-26

CHAPTER: 6

6 IMPLEMENTATION 27-32

6.1 CODING 27-32

CHAPTER 7

7 SNAPSHOTS 33-38
CHAPTER : 8

8 SOFTWARE TESTING 36-39

CHAPTER: 9

9 APPLICATION 40

9.1 FUTURE ENHANCEMENTS 40

9.2 ADVANTAGES 41

9.3 DISAVANTAGES 41

CHAPTER: 10

10 CONCLUSIONS 42-44

10.1 CONCLUSION 42-43

10.2 REFERENCES 44
LIST OF FIGURES
FIGURE NO. FIGURE NAME PAGE NO.

4.2.1 USE CASE DIAGRAM 15

4.2.2 DATA FLOW DIAGRAM 16

4.2.3 CONTENT LEVEL 0 DFD 17

4.2.4 CONTENT LEVEL 1 DFD 17

4.2.5 SEQUENCE DIAGRAM 19

4.2.6 STATE DIAGRAM 21

LIST OF TABLES

TABLE NO. TABLE NAME PAGE NO.

TABLE 1 TEST CASES 38-39

i
ABSTRACT:

Securing data encryption and decryption using Cryptography and Steganography


Techniques.Due to recent developments in stego analysis, providing security to personal
contents, messages, or digital images using steganography has become difficult.By using
stego analysis, one can easily reveal existence of hidden information in carrier files. This
project introduces a novel steganographic approach for communication between two private
parties. The approach introduced in this project makes use of both steganographic as well as
cryptographic techniques. In Cryptography we are using RSA.In Steganography we are
using Image Steganography for hiding the data. And we also use Mutual Authentication
process to satisfy all services in Cryptography i.e., Access Control, Confidentiality, Integrity,
Authentication. In this way we can maintain the data more securely.Since we use RSA
algorithm for securing the data and again on this we perform Steganography to hide the data
in an image. Such that any other person in the network cannot access the data present in the
network.Only the sender and receiver can retrieve the message from the data.

ii
CHAPTER 1

1
CHAPTER 1
INTRODUCTION

1.1 INTRODUCTION

Digital communication witnesses a noticeable and continuous development in many


applications in the Internet.Hence, secure communication sessions must be provided.The
security of data transmitted across a global network has turned into a key factor on the network
performance measures.So, the confidentiality and the integrity of data are needed to prevent
eavesdroppers from accessing and using transmitted data. Steganography and Cryptography are
two important techniques that are used to provide network security.The aim of this project is to
develop a new approach to hiding a secret information in an image, by taking advantage of
benefits of combining cryptography and steganography

CRYPTOGRAPHY

Cryptography is one of the traditional methods used to guarantee the privacy of


communication between parties. This method is the art of secret writing, which is used
to encrypt the plaintext with a key into ciphertext to be transferred between parties on
an insecure channel.Using a valid key, the ciphertext can be decrypted to the original
plaintext. Without the knowledge of the key, nobody can retrieve the
plaintext.Cryptography plays an essential role in many factors required for secure
communication across an insecure channel, like confidentiality, privacy, non-
repudiation, key exchange, and authentication.

There are of 2 types :-

Encryption cryptography: Cryptography is the science of concealing messages


with a secret code. Encryption is the way to encrypt and decrypt data.

Decryption cryptography:-Decryption is the process of converting an encrypted


message back to its original (readable) format. The original message is called the
plaintext message. The encrypted message is called the ciphertext message.

2
Symmetric / Secret Key Cryptography

The technique of Secret key encryption can also be known as the symmetric-
key, shared key, single-key, and eventually private-key encryption.The
technique of private key uses for all sides encryption and decryption of secret
data. The original information or plaintext is encrypted with a key by the sender
side also the similarly key is used by the receiver to decrypt a message to obtain
the plaintext. The key will be known only by a people who are authorized to the
encryption/decryption.However, the technique affords the good security for
transmission but there is a difficulty with the distribution of the key. If one stole
or explore the key he can get whole data without any difficulty.

• An example of Symmetric-Key is DES Algorithm.

Asymmetric / Public Key Cryptography

We can call this technique as asymmetric cryptosystem or public key cryptosystem, this
technique use two keys which are mathematically associated, use separately for
encrypting and decrypting the information. In this technique,when we use the private
key, there are no possibilities to obtain the data or simply discover the other key. The
key used for encryption is stored public therefore it’s called public key, and the
decryption key is stored secret and called private key.

An example of Asymmetric-Key Algorithm is RSA.

Steganography

It can be defined as the science of hiding and communicating data through apparently
reliable carriers in attempt to hide the existence of the data. So, there is no knowledge
of the existence of the message in the first place.

If a person views the cover which the information is hidden inside, he or she will have
no clue that there is any covering data, in this way the individual won’t endeavour to
decode the data.

3
The secret information can be inserted into the cover media by the stego system encoder
with using certain algorithm. A secret message can be plaintext, an image, ciphertext,
or anything which can be represented in form of a bitstream.
After the secret data is embedded in the cover object, the cover object will be called as
a stego object also the stego object sends to the receiver by selecting the suitable
channel, where decoder system is used with the same stego method for obtaining
original information as the sender would like to transfer.

1.2 HISTORY
In the early 1970s: IBM formed a 'crypto group,' which designed a block cypher to
protect its customers' data. In 1973, the US adopted it as a national standard - the Data
Encryption Standard, or DES. It remained in use until it cracked in 1997.

1.3 OBJECTIVE
CONFIDENTIALITY:-Confidentiality of data is enforced by using encryption.
Encryption algorithms can be symmetric – here sender and recipient of a message
need the same key – or asymmetric – sender and recipient use different keys.
INTEGRITY:-data integrity ensures full confidence that the data you are receiving
is the actual valid data from the sender, and has not been tampered with or
manipulated.
NON-REPUDIATION:-Assurance that the sender of information is provided with
proof of delivery and the recipient is provided with proof of the sender's identity, so
neither can later deny having processed the information.
AUTHENTICATION:- Cryptographic authentication identifies a user by proof of
possession of the private key component of a cryptographic credential.

1.4 EXISTING SYSTEM:

4
There are many algorithms for encryption decryption process like AES, DES, RSA in
which encryption is done with the help of substitutions and transformations on the
plaintext. It uses prime numbers for encryption process.

A. Cryptography using secret key (SKC): Secret key is a value independent of a


plaintext and of the algorithm. Single key is used for both encryption and decryption by
an algorithm. It includes Data Encryption Standard (DES) and Advanced Encryption
Standard (AES).

B. Cryptography using Public Key (PKC): Two different keys are used in this. One
key is used for encryption and another for decryption. It includes Rivest, Shamir,
Adleman (RSA) algorithm.

C. Hash Functions: It uses mathematical transformation for encryption which is


not recoverable from the cipher text.

1.5 LITERATURE SURVEY

• This literature survey provides an overview of message encryption and decryption


techniques used in the field of information security. Encryption and decryption play
a crucial role in ensuring the confidentiality and integrity of sensitive information
during its transmission or storage. This survey explores various encryption
algorithms, decryption methods, and their applications in different domains. It also
highlights the strengths, weaknesses, and recent advancements in encryption and
decryption technologies.

• This literature survey provides a comprehensive overview of message encryption


and decryption techniques, covering both traditional and advanced Methods. It
serves as a valuable resources for researcher , practitionier and students interested
in current state of message Encrypytion and decryption technologies and their
application.

5
1.6 PROPOSED SYSTEM

Proposed method which combines two different hiding techniques, which


are Cryptography and Steganography.In this proposed method first, the
message is encrypted by use RSA algorithm. After that, we use the
modified LSB technique to embed the encrypted information in image. So,
this technique combines the features of both cryptography and
steganography and provides a high level of security. It is better than either
of the technique used separately.

There will be an agreement between the sender and the receiver about the
key for the concealment algorithm as well as the key for the encryption
algorithm or these keys may be exchanged by a secure communication
method.Our method starts by encryption first then hide encrypted data.

1.7 Motivation
Cryptography, the practice of securing communication and information, is
driven by several key motivations. These motivations arise from the need
to protect sensitive data, ensure privacy, and establish trust in various
aspects of our modern digital world. Here are some of the primary
motivations for cryptography:

1. Confidentiality: Cryptography aims to provide confidentiality by


encoding information in such a way that only authorized parties can
understand it. It prevents unauthorized individuals from accessing or
understanding the contents of a message or data.

6
2. Data Integrity: Cryptographic techniques are employed to ensure the
integrity of data, meaning that it remains unaltered during transmission or
storage. By using techniques such as digital signatures and message
authentication codes, cryptography can detect any unauthorized
modifications or tampering with the data.

3. Authentication: Cryptography provides means for authentication,


verifying the identity of individuals or entities involved in a
communication or transaction. Digital signatures, certificates, and
cryptographic protocols help establish trust and ensure that the intended
parties are genuinely who they claim to be.

4. Non-Repudiation: Cryptographic techniques enable non-repudiation,


preventing individuals from denying their involvement in a transaction or
communication. Digital signatures, for instance, provide proof of the
authenticity and integrity of a message, making it challenging for the signer
to later deny their participation.

5. Privacy: In an era of increased digital surveillance and data collection,


cryptography helps preserve privacy. Techniques such as encryption allow
individuals to protect their personal information, online activities, and
communication from unauthorized surveillance, ensuring that only
intended recipients can access the information.

6. Secure Transactions: Cryptography plays a vital role in securing online


transactions, such as e-commerce and online banking. It enables secure
communication between parties, ensuring that sensitive information, such

7
as credit card details, remains confidential and protected from interception
or misuse.

7. Trust and Security: Cryptography helps establish trust in digital


systems and networks. By employing cryptographic algorithms and
protocols, organizations and individuals can create secure environments,
protecting their sensitive data and fostering trust among users, customers,
and partners.

8. Compliance and Regulations: Cryptography is often required by laws,


regulations, and industry standards to protect sensitive information.
Compliance with data protection regulations, such as the General Data
Protection Regulation (GDPR), often necessitates the use of encryption and
other cryptographic measures.

9. National Security: Cryptography has significant implications for


national security. Governments and military organizations use advanced
cryptographic techniques to protect classified information, secure
communication channels, and safeguard critical infrastructure from cyber
threats.

8
CHAPTER 2

9
CHAPTER 2
PROJECT DESCRIPTION
2.1 GENERAL

Cryptography is a field that deals with the science and art of securing communication
and information through the use of mathematical algorithms and techniques. It involves
the study, development, and application of various cryptographic algorithms, protocols,
and systems to protect data confidentiality, integrity, authentication, and non-
repudiation.

At its core, cryptography is concerned with transforming plaintext (original, readable


data) into ciphertext (encrypted, unreadable data) using encryption algorithms. This
process involves applying mathematical operations and transformations to the plaintext,
typically with the use of a secret key or keys. The resulting ciphertext can only be
deciphered and understood by authorized individuals who possess the corresponding
key or keysAL:

2.2 METHODOLOGIES

Identify the encryption and decryption requirements: Determine the specific needs
for message encryption and decryption, such as the level of security required, key
management, and compatibility with existing systems.
Select appropriate encryption algorithms: Choose suitable encryption algorithms
based on factors like security, performance, and key length. Consider both
symmetric and asymmetric encryption algorithms.
Determine key management procedures: Establish protocols for generating,
distributing, and storing encryption keys securely. Key management is crucial for
maintaining the confidentiality of encrypted messages.
Implement encryption and decryption modules: Develop software or hardware
modules to perform encryption and decryption operations. These modules should
be efficient, secure, and compatible with the target system.

10
Integrate encryption and decryption modules: Integrate the encryption and
decryption modules into the existing messaging system or application. Ensure
proper data flow and compatibility with other system components.
Test and validate the implementation: Conduct rigorous testing to verify the
correctness and effectiveness of the encryption and decryption techniques. Test
against known attacks and evaluate performance metrics.
Deploy and monitor the system: Once the encryption and decryption modules are
successfully implemented, deploy the system in the intended environment. Monitor
the system for any vulnerabilities, updates, or emerging threats.

2.3 TECHNIQUE USED OR ALGORITHM USED

DES:-Data Encryption Standard


Data encryption standard (DES) has been found vulnerable to very powerful attacks
and therefore, the popularity of DES has been found slightly on the decline.

DES is a block cipher and encrypts data in blocks of size of 64 bits each, which
means 64 bits of plain text go as the input to DES, which produces 64 bits of
ciphertext.

The same algorithm and key are used for encryption and decryption, with minor
differences.

The key length is 56 bits.

AES:-Advanced Encryption Standard


It is a specification for the encryption of electronic data established by the U.S
National Institute of Standards and Technology (NIST) in 2001.

AES is widely used today as it is a much stronger than DES and triple DES despite
being harder to implement.

AES is a block cipher.

The key size can be 128/192/256 bits.

Encrypts data in blocks of 128 bits each.

11
RSA:-Rivest-Shamir-Adleman
RSA algorithm is an asymmetric cryptography algorithm. Asymmetric actually means
that it works on two different keys i.e. Public Key and Private Key.

As the name describes that the Public Key is given to everyone and the Private key is
kept private. client (for example browser) sends its public key to the server and
requests some data.

The server encrypts the data using the client’s public key and sends the encrypted data.

The client receives this data and decrypts it.

DIFFIEHELLMAN
Diffie-Hellman key exchange is a method of digital encryption that securely exchanges
cryptographic keys between two parties over a public channel without their
conversation being transmitted over the internet.

The two parties use symmetric cryptography to encrypt and decrypt their messages.

MAC ( MESSAGE AUTHENTICATION CODE )


A family of cryptographic functions that is parameterized by a symmetric key.

Each of the functions can act on input data (called a “message”) of variable length to
produce an output value of a specified length.

The output value is called the MAC of the input message.

2.3.1 EXISTING TECHNIQUE:-

12
Cryptography is the science of securing information by converting it into a form that
is unintelligible to unauthorized individuals.

The Advanced Encryption Standard (AES) is widely used as a symmetric encryption


algorithm, offering secure data encryption and decryption.

RSA, an asymmetric encryption algorithm, relies on the difficulty of factoring large


numbers and is commonly used for secure data transmission and key exchange.

The Diffie-Hellman Key Exchange protocol allows two parties to securely establish a
shared secret key over an insecure communication channel.

Elliptic Curve Cryptography (ECC) offers strong security with shorter key lengths,
making it efficient for resource-constrained environments like mobile devices.

Hash functions such as SHA-256 and MD5 are used to ensure data integrity and create
unique message digests.

Digital signatures use asymmetric key algorithms to provide authenticity and integrity
for digital documents, enabling verification of the sender's identity.

Transport Layer Security (TLS) and Secure Sockets Layer (SSL) are widely used
cryptographic protocols for securing internet communications, including web browsing
and email.

Homomorphic encryption allows computation on encrypted data without decrypting it,


preserving data privacy in cloud computing and other applications.

Zero-knowledge proofs enable proving the truth of a statement without revealing


additional information, ensuring privacy and authentication in various protocols and
applications.

2.3.2 PROPOSED TECHNIQUE:


1. Quantum-resistant cryptography is a proposed system that aims to withstand attacks
from powerful quantum computers by utilizing algorithms resistant to quantum
algorithms.
2. Fully homomorphic encryption (FHE) is a proposed cryptographic system that
allows performing arbitrary computations on encrypted data, preserving privacy while
enabling powerful data processing.

13
3. Attribute-based encryption (ABE) is a proposed system where access to encrypted
data is granted based on specific attributes or conditions, enhancing fine-grained access
control and data security.
4. Zero-knowledge proofs with enhanced functionalities, such as non-interactive zero-
knowledge proofs and succinct zero-knowledge proofs, are proposed to provide
stronger privacy guarantees and efficient verification in various applications.
5. Multi-party computation (MPC) protocols are proposed cryptographic systems that
enable secure collaborative computations among multiple parties without revealing
their inputs, ensuring privacy and trust in distributed environments.

14
CHAPTER 3

15
CHAPTER 3
REQUIREMENTS ENGINEERING

3.1 GENERAL
In a country like India, accident is a major problem which must be solved using new
technologies rather than traditional ways.

Indian commuters travel approximately 35 km/day, out of that 75% commute using private
vehicles. If the average speed is around 60 km/h then every person spends 30 minutes per
day travelling. One crore people travel per day so people spend approximately 570 years
in driving per day. This is too much time spent on just driving.

77.3% accidents caused because of Human error (2018). One-fourth of the Indian drivers
use phones while driving which is dangerous for everybody (survey 2015).

3.2 HARDWARE REQUIREMENTS


The hardware requirements may serve as the basis for a contract for the
implementation of the system and should therefore be a complete and consistent
specification of the whole system. They are used by software engineers as the starting point
for the system design. It should what the system do and not how it should be implemented.

Processor - Intel
Speed - 1.1 GHz
Ram - Minimum of 256 MB or
higher
Hard Disk - 10 GB or higher
Key Board - Standard 110 keys Keyboard
Mouse - Two or Three Button Mouse
Monitor - 15” or 17” color monitor
3.3 SOFTWARE REQUIREMENTS
Operating System - Windows 11

Coding Language - Python

3.4 FUNCTIONAL REQUIREMENTS

Confidentiality: Cryptography should ensure the confidentiality of sensitive information.


It should protect data from unauthorized access or disclosure by encrypting it in a way that
only authorized parties can decipher and understand. Integrity: Cryptography should
maintain the integrity of data, ensuring that it remains unaltered and uncorrupted during
storage, transmission, or processing. Any unauthorized modifications or tampering
attempts should be detectable. Authentication: Cryptography should provide mechanisms
for verifying the identity of users, systems, or entities involved in a communication or
transaction. It should ensure that the intended parties are indeed who they claim to be,
preventing impersonation or unauthorized access. Non-repudiation: Cryptography should
offer non-repudiation mechanisms, ensuring that the parties involved in a communication
or transaction cannot deny their involvement or the validity of their actions. This
requirement is particularly important in digital signatures and proof of origin. Key
Management: Cryptography involves the use of cryptographic keys for encryption,
decryption, and other operations. Key management is crucial to ensure the secure
generation, distribution, storage, and revocation of keys. It should also address key rotation,
key recovery, and key backup procedures. Performance: Cryptographic algorithms should
be efficient and capable of processing data in a reasonable amount of time, especially for
real-time or latency-sensitive applications. The performance requirements may differ based
on the system's computational resources and the nature of the cryptographic operations.
Interoperability: Cryptography should be compatible with different platforms, systems, and
protocols to facilitate secure communication and data exchange between heterogeneous
environments. Standardization and adherence to widely accepted cryptographic standards
can help achieve interoperability.

19
CHAPTER 4

20
CHAPTER 4
DESIGN ENGINEERING

4.1 GENERAL

Design Engineering deals with the various UML [Unified Modelling language]
diagrams for the implementation of project. Design is a meaningful engineering
representation of a thing that is to be built. Software design is a process through
which the requirements are translated into representation of the software. Design
is the place where quality is rendered in software engineering. Design is the
means to accurately translate customer requirements into finished product.
4.2 UML DIAGRAMS

4.2.1 USE CASE DIAGRAM

Fig 4.2.1: Use Case Diagram

EXPLANATION:

A use case diagram at its simplest is a representation of a user's interaction with


the system that shows the relationship between the user and the different use cases
in which the user is involved.

A use case diagram can identify the different types of users of a system and
the different use cases and will often be accompanied by other types of
diagrams as well. The use cases are represented by either circles or ellipses.

36
4.2.2 CLASS DIAGRAM

Fig 4.2.2: Class Diagram

EXPLANATION

A class diagram in the Unified Modelling Language is a type of static structure


diagram that describes the structure of a system by showing the system's classes, their
attributes, operations (or methods), and the relationships among objects.
Class diagram is a static diagram.It represents the static view of an application.
Class diagram describes the attributes and operations of a class and also the constraints
imposed on the system.
The class diagrams are widely used in the modelling of object-oriented systems because
they are the only UML diagrams, which can be mapped directly with object-
oriented languages.

37
4.2.3 SEQUENCE DIAGRAM

EXPLANATION:
A sequence diagram shows object interactions arranged in time sequence.
It depicts the objects and classes involved in the scenario and the sequence of
messages exchanged between the objects needed to carry out the functionality of
the scenario.
Sequence diagrams are typically associated with use case realizations in the
Logical View of the system under development.
Sequence diagrams are sometimes called event diagrams or event scenarios.

38
4.2.5 ACTIVITY DIAGRAM

Fig 4.2.5: Activity Diagram

EXPLANATION:
Activity diagrams are graphical representations of workflows of stepwise
activities and actions with support for choice, iteration and concurrency.
In the Unified Modeling Language, activity diagrams are intended to model both
computational and organizational processes (i.e., workflows) as well as the data
flows intersecting with the related activities.
Although activity diagrams primarily show the overall flow of control, they
can also include elements showing the flow of data between activities through
one or more data stores.
.

39
4.3 SYSTEM ARCHITECTURE

A typical system architecture diagram for a cryptographic system might include


the following components:

Users/Clients: These are the entities or individuals who interact with the
cryptographic system, such as sending or receiving encrypted data, generating
keys, or performing cryptographic operations.

Encryption/Decryption Module: This module handles the encryption and


decryption operations. It takes plaintext data from users/clients and applies an
encryption algorithm along with an encryption key to produce ciphertext.
Similarly, it performs decryption using a decryption key to transform ciphertext
back into plaintext.

40
Key Management: This component is responsible for generating, storing, and
distributing cryptographic keys. It includes functionalities like key generation,
key storage, key exchange, and key revocation.

Cryptographic Algorithms: These are the mathematical algorithms used for


encryption, decryption, key exchange, and other cryptographic operations. This
may include symmetric encryption algorithms (e.g., AES), asymmetric
encryption algorithms (e.g., RSA), hash functions (e.g., SHA-256), or other
cryptographic primitives.

Secure Communication Channels: These channels ensure the secure


transmission of encrypted data between users/clients and the cryptographic
system. It may involve protocols such as TLS/SSL to establish secure
connections and protect data in transit.

Authentication/Authorization: This component verifies the identity of


users/clients and controls their access to the cryptographic system. It may involve
user authentication mechanisms (e.g., passwords, biometrics), access control
lists, or other authentication and authorization protocols.

Cryptographic Key Storage: This module securely stores cryptographic keys,


protecting them from unauthorized access. It may involve hardware security
modules (HSMs), key management systems, or secure databases.

Audit/Logging: This component records and logs various activities within the
cryptographic system, including key generation, key usage,
encryption/decryption operations, and user activities. It enables monitoring,
auditing, and forensic analysis for security and compliance purposes.

41
CHAPTER 5

42
CHAPTER 5
DEVELOPMENT TOOLS
Python
Python is a high-level, interpreted, interactive and object-oriented scripting language.
Python is designed to be highly readable. It uses English keywords frequently where as
other languages use punctuation, and it has fewer syntactical constructions than other
languages. History of Python
Python was developed by Guido van Rossum in the late eighties and early nineties at the
National Research Institute for Mathematics and Computer Science in the Netherlands.
Python is derived from many other languages, including ABC, Modula-3, C, C++,
Algol68, Small Talk, and UNIX shell and other scripting languages.
Python is copyrighted. Like Perl, Python source code is now available under the GNU
General Public License (GPL).
Python is now maintained by a core development team at the institute, although Guido van
Rossum still holds a vital role in directing its progress.
Importance of Python

Python is Interpreted − Python is processed at runtime by the interpreter. You do not


need to compile your program before executing it. This is similar to PERL and PHP.
Python is Interactive − you can actually sit at a Python prompt and interact with the
interpreter directly to write your programs.
Python is Object-Oriented − Python supports Object-Oriented style or technique of
programming that encapsulates code within objects.
Python is a Beginner's Language − Python is a great language for the beginner-level
programmers and supports the development of a wide range of applications from simple
text processing to WWW browsers to games.

Features of Python
Easy-to-learn − Python has few keywords, simple structure, and a clearly defined syntax.
This allows the student to pick up the language quickly.

43
Easy-to-read − Python code is more clearly defined and visible to the eyes.

Easy-to-maintain − Python's source code is fairly easy-to-maintain.

A broad standard library − Python's bulk of the library is very portable and cross
platform compatible on UNIX, Windows, and Macintosh.
Interactive Mode − Python has support for an interactive mode which allows interactive
testing and debugging of snippets of code.
Portable − Python can run on a wide variety of hardware platforms and has the same
interface on all platforms.
Extendable − you can add low-level modules to the Python interpreter. These modules
enable programmers to add to or customize their tools to be more efficient.
Databases − Python provides interfaces to all major commercial databases.

GUI Programming − Python supports GUI applications that can be created and ported to
many system calls, libraries and windows systems, such as Windows MFC, Macintosh,
and the X Window system of Unix.
Scalable − Python provides a better structure and support for large programs than shell
scripting.
Apart from the above-mentioned features, Python has a big list of good features, few are
listed below –

It supports functional and structured programming methods as well as OOP.

It can be used as a scripting language or can be compiled to byte-code for building large
applications.
It provides very high-level dynamic data types and supports dynamic type checking.
It supports automatic garbage collection.

It can be easily integrated with C, C++, COM, ActiveX, CORBA, and Java.

Libraries used in python:

• NUMPY - mainly useful for its N-dimensional array objects.

• PANDAS - Python data analysis library, including structures such as dataframes.

44
• MATPLOTLIB - 2D plotting library producing publication quality figures.

• SCIKIT-LEARN - the machine learning algorithms used for data analysis and data
mining tasks.

Fig 5: Libraries used in Python

45
CHAPTER 6

46
CHAPTER 6
IMPLEMENTATION
6.1 CODING:

from tkinter import *

import base64

from tkinter import messagebox

import tkinter.font as font

#Encoding Function

def encode(key, msg):

enc = []

for i in range(len(msg)):

list_key = key[i % len(key)]

list_enc = chr((ord(msg[i]) +

ord(list_key)) % 256)

enc.append(list_enc)

return base64.urlsafe_b64encode("".join(enc).encode()).decode()

#Decoding Function

def decode(key, code):

dec = []

47
enc = base64.urlsafe_b64decode(code).decode()

for i in range(len(enc)):

list_key = key[i % len(key)]

list_dec = chr((256 + ord(enc[i]) - ord(list_key)) % 256)

dec.append(list_dec)

return "".join(dec)

#Function that executes on clicking Show Message function

def Result():

msg = Message.get()

k= key.get()

i = mode.get()

if (i==1):

Output.set(encode(k, msg))

elif(i==2):

Output.set(decode(k, msg))

else:

messagebox.showinfo( 'Please Choose one of Encryption or Decrption. Try again.')

#Function that executes on clicking Reset function

def Reset():

Message.set("")
48
key.set("")

mode.set(0)

Output.set("")

wn = Tk()

wn.geometry("500x500")

wn.configure(bg='azure2')

wn.title("Encrypt and Decrypt your Messages")

Message = StringVar()

key = StringVar()

mode = IntVar()

Output = StringVar()

headingFrame1 = Frame(wn,bg="gray91",bd=5)

headingFrame1.place(relx=0.2,rely=0.1,relwidth=0.7,relheight=0.16)

headingLabel = Label(headingFrame1, text="Encryption and \nDecryption", fg='grey19',


font=('Courier',13,'bold'))

headingLabel.place(relx=0,rely=0, relwidth=1, relheight=1)

49
label1 = Label(wn, text='Enter the Message', font=('Courier',10))

label1.place(x=10,y=150)

msg = Entry(wn,textvariable=Message, width=35, font=('calibre',10,'normal'))

msg.place(x=200,y=150)

label2 = Label(wn, text='Enter the key', font=('Courier',10))

label2.place(x=10,y=200)

InpKey = Entry(wn, textvariable=key, width=35,font=('calibre',10,'normal'))

InpKey.place(x=200,y=200)

label3 = Label(wn, text='Check one of encrypt or decrypt', font=('Courier',10))

label3.place(x=10,y=250)

Radiobutton(wn, text='Encrypt', variable=mode, value=1).place(x=100,y=300)

Radiobutton(wn, text='Decrypt', variable=mode, value=2).place(x=200,y=300)

label3 = Label(wn, text='Result', font=('Courier',10))

label3.place(x=10,y=350)

res = Entry(wn,textvariable=Output, width=35, font=('calibre',10,'normal'))

res.place(x=200,y=350)
50
ShowBtn = Button(wn,text="Show Message",bg='yellow',
fg='black',width=15,height=1,command=Result)

ShowBtn['font'] = font.Font( size=12)

ShowBtn.place(x=180,y=400)

ResetBtn = Button(wn, text='Reset', bg='green', fg='black',


width=15,height=1,command=Reset)

ResetBtn['font'] = font.Font( size=12)

ResetBtn.place(x=15,y=400)

QuitBtn = Button(wn, text='Exit', bg='red', fg='black',width=15,height=1,


command=wn.destroy)

QuitBtn['font'] = font.Font( size=12)

QuitBtn.place(x=345,y=400)

wn.mainloop()

51
CHAPTER 7

52
CHAPTER 7
SNAPSHOTS
7.1 SNAPSHOTS

Code for message ceryptography

53
OUTPUT FOR MESSAGE CRYPTOGRAPHY

54
ENCRYPTION USING KEY

IMAGE STEGANOGRAPHY

55
IMAGE HIDING USING STEGANOGRAPHY

56
CHAPTER 8

57
CHAPTER 8
SOFTWARE TESTING

Software testing plays a crucial role in ensuring the security and reliability of

cryptographic systems. Here are some common software testing techniques used in
cryptography:

Functional Testing: This type of testing focuses on verifying that the cryptographic
algorithms and operations are functioning correctly according to the specifications. It
involves testing encryption, decryption, key generation, key exchange, and other
cryptographic operations to ensure they produce the expected results.

Security Testing: Security testing is performed to identify vulnerabilities and weaknesses


in a cryptographic system. It involves techniques such as penetration testing, vulnerability
scanning, and threat modeling to uncover potential security flaws and validate the system's
resistance against known attack vectors.

Performance Testing: Performance testing assesses the efficiency and scalability of


cryptographic algorithms and operations. It involves measuring the system's response
time, throughput, and resource utilization under varying workloads to ensure that it can
handle the expected cryptographic computations efficiently.

Fuzz Testing: Fuzz testing, or fuzzing, is a technique where the system is tested by feeding
it with invalid, unexpected, or random inputs to identify potential bugs or vulnerabilities.
Fuzz testing can help uncover implementation flaws or weaknesses in cryptographic
libraries or protocols.

58
Compatibility Testing: Compatibility testing ensures that the cryptographic system can
interact and function correctly with different platforms, operating systems, libraries, and
network protocols. It involves testing interoperability, data exchange, and compatibility
with various hardware and software configurations.

Regression Testing: Regression testing is performed after making changes or updates to


the cryptographic system to ensure that the modifications have not introduced new bugs
or affected existing functionalities. It involves retesting critical components and
functionalities to validate their continued correctness and security.

Usability Testing: Usability testing focuses on assessing the user-friendliness and ease of
use of the cryptographic system. It involves evaluating the system's user interface, user
documentation, error handling, and feedback mechanisms to ensure that users can interact
with the system effectively and securely.

Code Review and Static Analysis: These techniques involve reviewing the source code
of the cryptographic system for potential vulnerabilities, logic errors, or coding mistakes.
Static analysis tools can help identify common coding issues and security flaws without
executing the code.

Cryptographic Protocol Analysis: This type of testing focuses on analyzing the security
properties of cryptographic protocols, such as key exchange or authentication protocols. It
involves formal methods, model checking, or symbolic analysis to verify the protocol's
security properties and identify potential vulnerabilities.

59
CHAPTER 9

60
CHAPTER 9
APPLICATION

9.1 FUTURE ENHANCEMENT

The interaction procedure of user and the web application can be further more
improved to make it interactive and user friendly .
The web page layout may be improved .we are trying to upgrade it into a file storage
site as well as a file sharing site so that more users can be attracted.
We think more flexibility and interactive features can make it more bigger.

(i) Secret Communication : Steganography does not advertise secret communication


and therefore avoids scrutiny of the sender message. A trade secret, blueprint, or other
sensitive information can be transmitted without alerting potential attackers.
(ii) Feature Tagging : Elements can be embedded inside an image, such as the names
of the individuals in a photo or location in a map. Copying the stego image also copies
all of the embedded features and only parties who possess the decode stego key will be
able to extract and view the features.
(iii) Copyright Protection : Copy protection mechanisms that prevent the data, usually
digital data from being copied. The insertion and analysis of water marks to protect
copyrighted material is responsible for the percent rise of interest digital steganography
and data embedding.

60
ADVANTAGES:

1.Security: Encryption ensures that the message remains secure and


confidential, protecting it from unauthorized access
2. Versatility: Python is a versatile language that can be used to encrypt and
decrypt messages in different formats, including text, images, and videos.
3. Efficiency: Python offers built-in libraries such as cryptography that makes
encryption and decryption easy and efficient.
4. Scalability: Python's ability to handle large volumes of data makes it a good
choice for encrypting and decrypting messages.
5. Accessibility: Python is an open- source language, and its encryption
libraries are available for free, making it accessible to a large number of
developers

DISADVANTAGES:

1. Complexity: Encryption and decryption can be complex and require a good


understanding of cryptographic techniques and algorithms.

2. Implementation: Incorrect implementation of encryption and decryption can result


in vulnerabilities, making the message easily accessible to hackers and other malicious
actors.

3. Performance: Encryption and decryption can be computationally intensive and may


impact the performance of the system, especially when dealing with large volumes of
data.

4. Key management: Managing encryption keys can be challenging, especially when


dealing with multiple keys and ensuring their confidentiality and integrity.

5. Compatibility: Encrypted messages may not be compatible with all devices and
applications, requiring additional software or configuration to decrypt and access the
message.

61
CHAPTER 10

62
CHAPTER -10
CONCLUSION

10.1 CONCLUSION

In this project, we deal with the concepts of security of digital data


communication across the network. This project is designed by using the
steganography and cryptography features factors for better performance. We
performed a new steganography method and combined it with RSA Encryption
algorithm. We performed our method on image by implementing a program
written in Python language. The method proposed has proved successful in
hiding various types of text, images, audio and videos in colour images. We
concluded that in our method the Image files and RSA Cryptography are better
. Because of their high capacity. Results achieved indicate that our proposed
method is encouraging in terms of security and robustness.

REFERNCES

10.2 REFERNCES

63
[1] Surbhi Singla, Anju Bala, Cryptography and Steganography Algorithm for Cloud
Computing

https://www.semanticscholar.org/paper/A-Review%3A-Cryptography-and-
Steganography-Algorithm-Singla-
Bala/dc1b0833cada439c33a873aef472c560961d2833/figure/2

[2] Aya Y. AlKhamese, Wafaa R. Shabana, Ibrahim M. Hanafy, Data Security in Cloud
Computing Using Steganography

https://www.semanticscholar.org/paper/Data-Security-in-Cloud-Computing-Using-A-
Review-AlKhamese-Shabana/2fda9f290f571c71ac218e833b990738585c4ee9

[3] Punam V Maitri, Aruna Verma, Cloud computing implementing hybrid


cryptography algorithm

[4] K. Thangadurai, G. Sudha Devi, An analysis of LSB based image steganography


techniques

[5] Aayushi Ajmera, Shiraz Saptarshi Ghosh, T Vijayetha, Secure LSB Steganography
over Modified Vigenère-AES Cipher and Modified Interrupt Key-AES Cipher

64

You might also like