Mini Project Format 2024-25
Mini Project Format 2024-25
Message Detection”
Signature:
Name: AAAAAAA
Date:
                                                                                      ii
                                      CERTIFICATE
This is to certify that the Project Report entitled “Image and Audio Steganography with
Suspicious Message Detection” which is submitted by Student Name (Roll Noof the 2nd
semester, in the year 2024-2025.
In partial fulfillment of the requirement for the award of degree of B.Tech in department of
Computer Science & Engineering of Dr. APJ Abdul Kalam Technical University is a record
of the candidate own work carried out by him/her under my supervision. The matter embodied
in this thesis is original and is not been submitted for the award of any degree.
 Signature                                           Signature
 Mr. Rahul Singh)                                    (Mr. XYZ)
 (Head of Department)                                (Assistant Professor)
 CSE Department                                      CSE Department
 KIT Kanpur                                          KIT Kanpur
Date:
                                                                                               iii
                          ACKNOWLEDGEMENT
It gives us a great sense of pleasure to present the report of the B.Tech Project undertaken during
B.Tech First Year. We owe special debt of gratitude to our guide Mr. XYZ of Department of
Computer Science & Engineering, Kanpur Institute of Technology, Kanpur (U.P) for his
constant support and guidance throughout course of our work. His sincerity, thoroughness and
perseverance have been a constant source of inspiration for us. It is only his cognizant efforts that
our endeavors have been light of the day.
We also take the opportunity to acknowledge the contribution of Mr. Rahul Singh , Head of
Department of Computer Science & Engineering, Kanpur Institute of Technology, Kanpur
(U.P.) for his full support and assistance during the development of the project.
We also do not like to miss the opportunity to acknowledge the contribution of all faculty members
of the department for their assistance and cooperation during the development of my project. Last
but not the least, we acknowledge our friends for their contributions in the completion of the
project.
 Signature:
Name: AAAAAAA
Date:
                                                                                                  iv
                                   ABSTRACT
This thesis presents a website which helps to communicate and transfer messages efficiently
and secretly with the help of steganography algorithms. This application will be able to
detect the messages that are suspicious in order to prevent the threats to the military and
other agencies.
We have also implemented the suspicious message detection feature in the project.
The above said things were made to work with the help of various algorithms and
the machine learning models.
The user should be able to conceal the message in a cover like image or audio file without
visible alteration or noticeable changes. Since the cover can be uploaded by the user itself,
the hackers won’t be able to notice the difference without the original cover. Apart from that,
this application can be used for daily entertainment purpose where the user can send various
secret messages to other users.
The image or audio file will be encrypted using a randomly selected algorithm. After the
encryption, the image will be embedded with the encrypted information of algorithm which
will be known to the organization only. After successfully receiving the message, it will be
decrypted with the embedded information and the key entered by the receiver.
Overall, this can work as a base for the various intelligence agencies and other government
agencies where security is a primary concern.
                                                                                                  v
                         TABLE OF CONTENTS
1. Declaration                                      ii
2. Certificate                                     iii
3. Acknowledgement                                 iv
4. Abstract                                         v
5. List of Figures                                viii
INTRODUCTION                                        1
1.1 General Introduction                            1
1.2 Problem Statement                               1
1.2.1 Problem Detection                             1
1.2.2 Problem Solving                               2
1.3 Proposed System Overview                        2
1.4 Methodology                                     3
1.4.1 Principles of Agile                           4
1.4.2 Flow Chart                                    5
1.5 What is Steganography?                          5
1.5.1 Steganography techniques                      6
1.5.2 Advantages over cryptography                  6
1.5.3 Types of Steganography                        7
1.5.3.1 Image Steganography                         7
1.5.3.2 Audio Steganography                         7
1.5.3.3 Text Steganography                          8
1.5.3.4 Video Steganography                         8
1.6 Scope of the Project                            8
2. Feasibility Report                               9
2.1 Feasibility Study                               9
2.1.1 Technical Feasibility                         9
2.1.2 Economic Feasibility                          9
2.1.3 Operational Feasibility                       9
2.1.4 Legal Feasibility                            10
2.2 System Design                                  10
2.3 Description                                    10
3. Requirement Elicitation                         12
3.1 Requirement Analysis                           12
3.1.1 Requirements Gathering                       13
3.1.2 Analyzing Requirements                       13
3.2 Classification of Requirement                  13
3.2.1 Functional Requirements                      13
3.2.2 Non-Functional Requirements                 14
4. Designing                                      16
4.1 Modular Architecture Design                   16
4.2 Detailed Design                               16
4.3 ER Diagram                                    16
4.3.1 The components and features                 17
                                             vi
4.3.1.1 Entity                                                 17
4.3.1.2 Relationship                                           17
4.3.1.3 Attribute                                              17
4.4 Data Flow Diagram                                          18
4.4.1 Level 0 DFD                                              19
4.4.2 Level 1 DFD                                              19
4.4.3 Level 2 DFD                                              20
4.5 Use Case Diagram                                           21
5. Coding & Implementation                                     22
5.1 Implementation                                             22
5.2 Hardware                                                   22
5.3 IDE                                                        22
5.3.1 jQuery Code – Encrypting and Decrypting Messages         23
5.3.2: HTML Code – Front end                                   26
5.3.3: Python Code – Backend of Messaging Service              28
5.4 Machine learning Model                                     30
5.4.1 Working                                                  30
5.4.2 Algorithm used                                           30
5.4.3 Dataset used                                             30
5.4.4 Uploading data set                                       31
5.4.5 Training the Model                                       32
5.4.6 Output of the model                                      34
5.4.7 Steganography                                            35
5.5 Snapshots                                                  41
6. Testing                                                     51
6.1 Description of Agile                                       52
6.2 Diagram of Agile Model                                     52
6.3 Types of Testing                                           53
6.3.1 Black Box Testing                                        53
6.3.2 White Box Testing                                        54
7. Conclusion                                                  56
7.1 Future Scope                                               56
7.2 Uses & Targets                                             57
7.3 Applications                                               57
7.4 Result & Analysis                                          57
7.5 Limitations                                                58
References                                                     59
                                                         vii
           LIST OF FIGURES
Figures         Description            Page No.
 1.3.1          Basic Structure            3
 1.4.1           Agile Model               4
 1.4.2            Flow Chart               5
 1.5.1      Types of Steganography         7
 2.3.1    To indicate working model       10
 2.3.2       Screenshot (Desktop)         11
 2.3.3       Screenshot (Mobile)          11
3.1.2.1   Requirement Analysis Cycle      13
 4.3.1        Components of ER            17
 4.3.2           ER Diagram               18
 4.4.1           Level 0 DFD              19
 4.4.2           Level 1 DFD              19
 4.4.3           Level 2 DFD              20
 4.5.1        Use Case Diagram            21
5.4.6.1            LSB Input              36
5.4.6.2           LSB Output              37
5.4.6.3         Battlesteg Input          39
5.4.6.4        Battlesteg Output          40
 5.5.1       Login Activity Code          41
 5.5.2        Reg. Activity Code          41
 5.5.3       Follow Activity Code         42
 5.5.4     LSB Steganography Code         42
 5.5.5          Battlesteg Code           43
 5.5.6         Base of Frontend           44
 5.5.7            Dashboard               44
 5.5.8           Decision Tree            45
 5.5.9        Email Verification          46
5.5.10     Encrypt/Decrypt at Client      46
5.5.11       Front End Reg. Code          47
5.5.12          URL Mapping               47
5.5.13         Spam Detection             48
5.5.14          Chat Database             48
5.5.15      Reg. Verification Code        49
5.5.16      Token Passing at Client       49
5.5.17       Chat & Spam Bubble           50
5.5.18        Req. Configuration          50
 6.2.1               Agile                52
6.3.1.1        Blackbox Testing           53
6.3.2.1       Whitebox Testing            54
                                                  viii
                                       CHAPTER 1
                                   INTRODUCTION
 General Introduction
Since the rise of the Internet one of the most important factors of information technology and
communication has been the security of information. Cryptography was created as a technique for
securing the secrecy of communication and many different methods have been developed to encrypt
and decrypt data in order to keep the message secret. Unfortunately, it is sometimes not enough to
keep the contents of a message secret, it may also be necessary to keep the existence of the message
secret. The technique used to implement this, is called steganography.
Steganography differs from cryptography in the sense that where cryptography focuses on keeping
the contents of a message secret, steganography focuses on keeping the existence of a message
secret. Steganography and Cryptography are both ways to protect information from unwanted
parties but neither technology alone is perfect and can be compromised. Once the presence of
hidden information is revealed or even suspected, the purpose of steganography is partly defeated.
Problem Statement
A secure communication system to deliver sensitive information through images and audio files
using standard steganography tool and modified steganography algorithms.
Problem detection
In today’s era, most of the persons are anxious about the security of confidential information
because confidentiality is an energetic part. Sensitive information should be confidential because
data can be accessed by intruders. Secrecy of message has always been a challenging task. For
securing our communication, we use several types of steganography techniques.
According to EY’s latest Global Information Security Survey (GISS) 2018-19 – India edition, one
of the highest numbers of cyber threats have been detected in India, and the country ranks second in
terms of targeted attacks. Although Banking and Telecom are the most attacked sectors but
Manufacturing, Healthcare, and Retail have also faced a significant number of cyber-attacks.
Cryptography is the cornerstone of much of the internet. Cryptography allows to encrypt a message
in such a way that, if performed correctly, only 'legitimate' actors can decipher it in a reasonable
amount of time. However, while cryptography hides the content of the message, cryptography does
not hide that exchange of information is taking place. This proves critical in many real-world
applications, when the simple knowledge that encrypted communication is taking place between
actors is enough to map networks, or gain information about which kind of services are exchanged
or which kinds of protocols are used, therefore increasing dramatically the attack surface - not to
talk about being a possible motivation for exerting constraints, legal or physical, in view of
obtaining the decrypted message.
 Problem Solving
The main motivation behind this project is to enhance the communication between army stations,
secret government agencies, business intelligence etc.
This application will be able to detect the messages that are suspicious in order to prevent the
threats to the military and other agencies.
The user should be able to conceal the message in a cover like image or audio file without visible
alteration or noticeable changes. Since the cover can be uploaded by the user itself, the hackers
won’t be able to notice the difference without the original cover. Apart from that, this application
can be used for daily entertainment purpose where the user can send various secret messages to
other users.
The advantage of steganography, over cryptography alone, is that messages do not attract attention
to themselves. Plainly visible encrypted messages—no matter how unbreakable—will arouse
suspicion, and may in themselves be incriminating in countries where encryption is illegal.
Therefore, whereas cryptography protects the contents of a message, steganography can be said to
protect both messages and communicating parties. This method featured security, capacity, and
robustness, the three needed aspects of steganography that makes it useful in hidden exchange of
information through text documents and establishing secret communication.
Important files carrying confidential information can be in the server in and encrypted form No
intruder can get any useful information from the original file during transmit. With the use of
Steganography Corporation government and law enforcement agencies can communicate secretly.
For the implementation of the above-mentioned idea, we will be using a web application where the
users can register themselves with proper identification details. The users can upload the image or
audio file which we call ‘the cover’ and the secret message.
The ‘cover’ will be encrypted using from naïve to modified steganography algorithms. A ‘cover’
                                                                                                    2
will consist of encrypted message and receiver information which will be useful for decryption.
                                                                                                  3
The image or audio file will be encrypted using a randomly selected algorithm. After the
encryption, the image will be embedded with the encrypted information of algorithm which will be
known to the organization only. After successfully receiving the message, it will be decrypted with
the embedded information and the key entered by the receiver.
When a message is being encrypted, a classifier will be used to detect whether the message being
encrypted is normal or abnormal. If something suspicious is found, the admin of the site will be
immediately alerted.
In the proposed idea, we will be implementing the standard steganography tools and modified
version of these algorithms to encrypt and hide information in images and audio files as well as we
will be keeping a check on the suspicious messages and spams using machine learning tools.
Methodology
For the above described software, we have used the Agile Development Model.
                                                                                                 4
                               Fig. 1.4.1 Agile Model
Principles of Agile
  Satisfy the customer through early and continuous delivery of valuable software.
  Welcome changing requirements.
  Deliver working software frequently.
  Work together daily throughout the project.
  Build projects around motivated individuals who are supported and trusted to get
   the job done.
  Use face-to-face conversation whenever possible.
  Working software is the primary measure of progress.
  Maintain a constant pace indefinitely.
  Give constant attention to technical excellence and good design.
  Simplicity—the art of maximizing the amount of work not done—is essential.
  The best architectures, requirements, and designs emerge from self-organizing
   teams.
  Reflect on how to become more effective, then tune and adjust accordingly
   at regular intervals.
                                                                                      5
 Flow Chart
 WHAT IS STEGANOGRAPHY?
Steganography means “Masking of message” so that others will have no ability to recognize it.
While cryptography is a way of keeping and conducting data in a specific form so that only those
who are authorized recipient can recognize it. Steganography takes a step further by modification of
cryptography in the field of hiding encoded information, instead of observer nobody can suspects
its presence. Whoever detecting your documents will fail to recognize it. It consists encrypted data
key concept behind steganography.
                                                                                                  6
Steganography includes the concealment of information within computer files. In digital
steganography, electronic communications may include steganographic coding inside of a transport
layer, such as a document file, image file, program or protocol. Media files are ideal for
steganographic transmission because of their large size. For example, a sender might start with an
innocuous image file and adjust the color of every hundredth pixel to correspond to a letter in the
alphabet. The change is so subtle that someone who is not specifically looking for it is unlikely to
notice the change.
Steganography techniques
In modern digital steganography, data is first encrypted or obfuscated in some other way and then
inserted, using a special algorithm, into data that is part of a particular file format such as
a JPEG image, audio or video file. The secret message can be embedded into ordinary data files in
many different ways. One technique is to hide data in bits that represent the same
color pixels repeated in a row in an image file. By applying the encrypted data to this redundant
data in some inconspicuous way, the result will be an image file that appears identical to the
original image but that has "noise" patterns of regular, unencrypted data.
The practice of adding a watermark -- a trademark or other identifying data hidden in multimedia or
other content files -- is one common use of steganography. Watermarking is a technique often used
by online publishers to identify the source of media files that have been found being shared without
permission.
While there are many different uses of steganography, including embedding sensitive information
into file types, one of the most common techniques is to embed a text file into an image file. When
this is done, anyone viewing the image file should not be able to see a difference between the
original image file and the encrypted file; this is accomplished by storing the message with less
significant bites in the data file. This process can be completed manually or with the use of a
steganography tool.
Steganography is distinct from cryptography, but using both together can help improve the security
of the protected information and prevent detection of the secret communication. If
steganographically-hidden data is also encrypted, the data may still be safe from detection -- though
the channel will no longer be safe from detection. There are advantages to using steganography
combined with encryption over encryption-only communication.
The primary advantage of using steganography to hide data over encryption is that it helps obscure
the fact that there is sensitive data hidden in the file or other content carrying the hidden text.
Whereas an encrypted file, message or network packet payload is clearly marked and identifiable as
such, using steganographic techniques helps to obscure the presence of the secure channel.
                                                                                                   7
 Types of Steganography:
Image Steganography
Image Steganography is in which data is hidden within an image file. The image selected for it is
called as the cover-image and the image obtained after the steganography process is called the
stego- image. Image steganography is of various types.
In image steganography an image is usually the carrier that holds the secret information. Cover
image shows the image which is used for hiding the secret data as a payload. The embedding
technique is the algorithm which is useful for hiding the secret message inside the cover image with
the help of stego key. The stego-key needs to be shared with both the ends.
The ‘stego-image’ is the final output image that keeps the secret information hidden. There is also
an extraction technique which is the used to recover the secret message from stego-image with the
help of stego-key. The counter of steganography is steganalysis or an attack on steganography.
“Steganalysis is an art and science of detecting the existence or recovering the secret message from
stego images.”
Audio Steganography
It is the science of hiding some secret text or audio information in a host message. The host
message before steganography and stego message after steganography have the same
characteristics.
                                                                                                   7
    Text Steganography
Text steganography can involve anything from changing the formatting of an existing text, to
changing words within a text, to generating random character sequences or using context-free
grammars to generate readable texts.
Text steganography is believed to be the trickiest due to deficiency of redundant information which
is present in image, audio or a video file. The structure of text documents is identical with what we
observe, while in other types of documents such as in picture, the structure of document is different
from what we observe.
Therefore, in such documents, we can hide information by introducing changes in the structure of
the document without making a notable change in the concerned output.
Video Steganography
Video steganography is becoming an important research area in various data hiding technologies,
which has become a promising tool because not only the security requirement of secret message
transmission is becoming stricter but also video is more favoured.
This project is developed for hiding information in any image file. The scope of the project is
implementation of steganography tools for hiding information includes any type of information file
and image files and the path where the user wants to save Image and extruded file.
 This can be used as base for the use by various intelligent services organizations.
    There are distributed steganography methods including methodologies that distribute the
     payload through multiple carrier files in diverse locations to make detection more difficult.
 It aims to help certain defence organizations of the country where security is the primary aspect.
                                                                                                     8
                                       CHAPTER 2
                             FEASIBILITY REPORT
    Feasibility Study
The feasibility study is an evaluation and analysis of a proposed project which is based on extensive
investigation and research to support the process of decision making.
Feasibility study evaluates the project’s potential for success; therefore, perceived objectivity is an
important factor in 6th credibility of the study for potential investors and lending institutions.
    •   Technical
    •   Economic
    •   Operational
    •   Legal
 Technical Feasibility
The technical feasibility assessment is focused on gaining an understanding of the present technical
resources and their applicability to the expected needs of the proposed system.
To develop this project, developers should have knowledge about working with Python, Django
framework, Steganography, Cryptography and Machine Learning.
 Economic Feasibility
Economic Feasibility assessment typically involves a cost/benefit analysis. This project is economically
feasible because it implements on a cloud server as it is a web application. To access this web
application the user needs a phone or a tablet or any device that is connected to the internet and can run
an internet browser. This web app is available for free.
 Operational Feasibility
Operational feasibility is a measure of how well a proposed system solves the problems and takes
advantages of opportunities identified during scope definition and how it satisfies the requirements
identified in the requirement analysis phase of development.
This project is efficient, fast and gives better results. This web application can run on any day to
day devices which can access the internet and can run an internet browser.
                                                                                                       9
 Legal Feasibility
Determines whether the proposed system conflicts with legal requirements and whether the
proposed venture is acceptable in accordance to the laws of the land. This project does not
conflict with any legal requirements.
System Design
In this project we have designed a web application in which we can send messages securely
with a feature of hiding your messages on images and audio files. Also, it can block any spam
messages.
This web application let a user in with the help of login id and password. It uses PNG images
and wav audio files to hide the encrypted text message with capability of blocking any message
that is spammy. The encryption of text messages is done using AES algorithm and machine
learning is used to identify and block any spam messages.
Description
A user chats to another user on an ajax based chat system and it is ensured with the help of
machine learning algorithms that any user is not spamming to another user and no other third
party can access to the chats as we are using encryption and steganography to security and
privacy.
                                                                                                 10
Figure 2.3.1 To indicate Working of model
                                            11
Figure 2.3.2: Screenshot of the application (Desktop
                       View)
                                                       12
Figure 2.3.3: Screenshot of the application (Mobile View)
                                                            13
                                   CHAPTER 3
REQUIREMENT
                  ELICITATION
Requirement elicitation is the practice of collecting requirements of a system users that are
necessary for the Identification system.
Requirement elicitation is non-trivial because you can never be sure you get all requirements for
the users and customer by just asking them what the system should do or not do.
The objective of this phase is to clearly understand clients or customer’s requirements and to
systematically organize these requirements.
Requirements may be documented in various forms, usually including a summary list and may
include natural-language documents, use cases, use stories, or process specifications.
Requirement Analysis
Requirements analysis in systems engineering and software engineering, encompasses those tasks
that go into determining the needs or conditions to meet for a new or altered product or project,
taking account of possibly conflicting requirements of the various stakeholders, analyzing,
documenting, validating and managing software or system requirements.
Perhaps the greatest challenge being faced by software developers is to share the vision of the final
product with the customer. All stakeholders in a project - developers, end users, software managers,
customer managers - must achieve a common understanding of what the product will be and do, or
someone will be surprised when it is delivered. Surprises in software are almost never good news.
Therefore, we need ways to accurately capture, interpret, and represent the voice of customers when
specifying the requirements for a software product.
Requirements analysis is critical to the success or failure of a systems or software project. The
requirements should be documented, actionable, measurable, testable, traceable, related to
identified business needs or opportunities, and defined to a level of detail sufficient for system
design.
                                                                                                     14
It consists of following activities:
 Requirements Gathering
Eliciting requirements (e.g. The project chapter or definitions), business procedure, documentation,
and stakeholder interviews. This is sometimes also called requirements gathering.
Analyzing Requirements
It includes determining whether the stated requirements are clear , complete, consistent and
unambiguous, and resolving any apparent conflicts and classification of requirements.
    Classification of Requirements
The customers/users are not completely sure of what is needed, have a poor understanding of the
capabilities and limitations of their computing environment, don’t have a full understanding of the
problem domain, have trouble communicating needs to the system engineer, omit information that
is believed to be “obvious,” specify requirements that conflict with the needs of other
customers/users, or specify requirements that are ambiguous or untestable.
 Functional Requirements
The Functional Requirements Specification documents the operations and activities that a system
must be able to perform.
                                                                                                 15
Functional Requirements should include:
The Functional Requirements Specification describes what the system must do; how the system
does it is described in the Design Specification.
If a User Requirement Specification was written, all requirements outlined in the User Requirement
Specification should be addressed in the Functional Requirements Specification.
The Functional Requirements Specification should be signed by the System Owner and Quality
Assurance. If key end-users, developers, or engineers were involved with developing the
requirements, it may be appropriate to have them sign and approve the document as well.
Non-Functional Requirements
A non-functional requirement is a requirement that specifies criteria that can be used to judge the
operation of a system, rather than specific behaviors. They are contrasted with functional
requirements that define specific behavior or functions.
The plan for implementing non-functional requirements is detailed in the system architecture,
because they are usually Architecturally Significant Requirements. Non-functional requirements are
in the form of "system shall be <requirement>", an overall property of the system as a whole or of a
particular aspect and not a specific function.
A system may be required to present the user with a display of the number of records in a database.
This is a functional requirement. How current this number needs to be, is a non-functional
requirement. If the number needs to be updated in real time, the system architects must ensure that
the system is capable of displaying the record count within an acceptably short interval of the
number of records changing.
                                                                                                  16
Examples of non-functional requirements are as follows
 Performance
 Platform compatibility
 Portability
 Readability
 Fault tolerance
 Recovery
 Reliability
 aintainability
 Resilience
 Resource constraints
 Response time
 Reusability
 Robustness
 Scalability
 Stability
 Supportability
 Testability
 Transparency
 Usability
                                                         17
                                      CHAPTER 4
DESIGNIN
Software design deals with transforming the customer requirement, as describe in Software
Requirement Specification document, into a form is implementable using a programming language.
It is a technique of high-level design technique. Modular design focuses on physical entities on the
relationship between them. Identifying the entities containing your logical design constructs and
managing dependencies between the units of deployment are example of modular design. Without
modular design we may not realize the benefits you expect from your logical design.
• Design Modular software today, in anticipation of future platform support for modularity.
Detailed Design
Once high-level design is done, you have a graphical representation of the structure of your
software system a document that defines high-level details of each module in your system,
including a module’s interface (including input and output data types) notes on possible
algorithms or data structures the module can use to meet its responsibilities a list of any non-
functional requirements that might impact the module.
After high-level design, a designer’s focus shifts to low-level design Each module’s
responsibilities should be specified as precisely as possible Constraints on the use of its interface
should be specified pre and post conditions can be identified module-wide invariants can be
specified internal data structures and algorithms can be suggested.
ER Diagram
                                                                                                        18
ER diagram is an entity relationship diagram which shows a has a relationship or is a kind of
relationship between the entities and attributes. The entity is represented by rectangular box and
attributes by eclipse. The relationship between two entities is represented by diamond.
                                                                                               19
An entity relationship diagram (ERD) shows the relationships of entity sets stored in a database. An
entity in this context is a component of data. In other words, ER diagrams illustrate the logical
structure of databases.
                                                             Entity
A definable thing such as a person, object, concept or event—that can have data stored about it.
Think of entities as nouns. Examples: a customer, student, car or product. Typically shown as a
rectangle.
                                                          Relationship
How entities act upon each other or are associated with each other. Think of relationships as verbs.
For example, the named student might register for a course. The two entities would be the student
and the course, and the relationship depicted is the act of enrolling, connecting the two entities in
that way. Relationships are typically shown as diamonds or labels directly on the connecting lines.
                                                           Attribute
A property or characteristic of an entity. Often shown as an oval or circle.
A data flow diagram (DFD) is a graphical representation of the "flow" of data through an
information system. A DFD is often used as a preliminary step to create an overview of the system
without going into great detail, which can later be elaborated.
Data flow diagrams are also known as bubble charts. DFD is a designing tool used in the top-down
approach to Systems Design. This context-level DFD is next "exploded", to produce a Level 1
DFD that shows some of the detail of the system being modelled. The Level 1 DFD shows how the
system is divided into sub-systems (processes), each of which deals with one or more of the data
flows to or from an external agent, and which together provide all of the functionality of the
system as a whole. It also identifies internal data stores that must be present in order for the system
to do its job, and shows the flow of data between the various parts of the system.
                                                                                                     21
Level 0 DFD
Level 1 DFD
                                          22
Level 2 DFD
                                          23
Use Case Diagram
 A use case diagram is a graphic depiction of the interactions among the elements of a system. A
 use case is a methodology used in system analysis to identify, clarify, and organize system
 requirements.
 A UML use case diagram is the primary form of system/software requirements for a new
 software program underdeveloped. Use cases specify the expected behavior (what), and not the
 exact method of making it happen (how). Use cases once specified can be denoted both textual
 and visual representation (i.e. use case diagram). A key concept of use case modeling is that it
 helps us design a system from the end user's perspective. It is an effective technique for
 communicating system behavior in the user's terms by specifying all externally visible system
 behavior.
                                                                                              24
                                         CHAPTER 5
    Implementation
Implementation is the realization of an application, or execution of a plan, idea, model, design,
specification, standard, algorithms.
Implementation is the part of the process where software engineers actually program the code for the
project.
Software and Hardware implementation should always be designed with the end user in mind and
the implementation process usually benefits from user involvement.
If the users participate in the design and implementation of the system, ideally it will serve their
business objectives more accurately and reflect their priorities and the ways in which they
prefer to work.
Keeping in mind the need of modern lifestyle, the project is being implemented with the aim
of providing a better lifestyle.
Here we have implemented an android application for the user to control the electrical appliances.
Java coding along with php and android has given a better environment. webhost servers contains
all the tables and queries to be executed.
 Hardware
As of in our project there is no such hardware requirement. It only requires a system with –
      Any 3G/4G internet network
      JavaScript supported browsers like Chrome, Firefox etc.
      OS- Windows, Linux, Mac, Android
The concept of IDE evolved from simple command-based software which was not as useful as
menu- driven software. Modern IDEs are mostly used in the context of visual programming, where
applications are quickly created by moving programming building blocks or code nodes that
generate flowchart and structure diagrams, which are compiled or interpreted.
Selecting a good IDE is based on factors, such as language support, operating system (OS) needs
and costs associated with using the IDE etc.
A collection of utilities combined in to single desktop application that does the following-
To implement encryption and decryption we have used Advanced Encryption Standard (AES)
Algorithm as described in previous section.
                                                                                               26
$.ajaxSetup({
   async: false
 });
$(document).ready(function(){
    // Reference to the chat messages area
// let $chatWindow = $("#messages");
  let $chatWindow = $(".chat-bubbles-body");
 let $chat_id;
 let $sender;
 let $receiver;
 let $chat_key;
 $chat_id = document.getElementById("chat_id").value;
 $sender = document.getElementById("sender").value ;
 $receiver = document.getElementById("receiver").value ;
 function sendmessagetoserver(msg){
   $.getJSON(
      "/receivemsg",
      {
        chat_id : $chat_id,
        From : $sender,
        To : $receiver,
        message: msg
      },
      function(data){
        if(data.status==="success")
        {
          $received_msg = data.message_from_python;
          console.log($received_msg);
          printMessage($sender , $received_msg);
        }
      }
    )
 }
function receivemessgefromserver(){
  $.getJSON( "/
     sendmsg",
    {
      chat_id : $chat_id,
      From : $receiver,
      To : $sender,
     },
function(data){
   if (data.status==="success")
   {
     for(i=0;i<data.length;i++)
     {
       printMessage( $receiver , data.messages[i]);
     }
   }
                                                           27
            setTimeout(receivemessgefromserver , 2000);
        }
        )
    }
        // decryption
        var decrypted = CryptoJS.AES.decrypt({ciphertext: ciphertext}, key, {
           iv: iv
        });
        console.log(decrypted);
        return decrypted.toString(CryptoJS.enc.Utf8);
}
});
                                                                                28
 : HTML Code – Front end
Now let’s code the front end of our website. Following codes are written using HTML and JINJA3
in order to work with Django.
{% extends "base.html" %}
{% load staticfiles %}
{% block title %}Log-in{% endblock %}
{% block content %}
<div class="login">
<h1>Log-in</h1>
{% if notvalid %}
<p>
  Your Username and password didn't match. Please try again.
</p>
{% elif notactive %}
  <p>
     Your account is not activated yet. Kindly check your email.
  </p>
{% else %}
  {% if loggedout %}
  <p>Logged out successfully</p>
  {% elif registered %}
  <p>Registered Successfully!!</p>
  {% endif %}
  <p> Please Use the following form to login</p>
{% endif %}
<div class="login-form">
 </div>
</div>
</div>
</div>
{% endblock %}
                                                                                                       29
Front end Code for Chat window:
{% load static %}
<!DOCTYPE html>
<html>
<head>
  <title>{{room.name}} | TalkChat</title>
  <link href='https://fonts.googleapis.com/css?family=Montserrat' rel='stylesheet'>
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-
awesome.min.css">
  <link rel="stylesheet" href="{% static "chat/styles/chat.css" %}">
</head>
<body>
<input type="hidden" id="sender" name="variable" value="{{ sender }}">
 <input type="hidden" id="receiver" name="variable" value="{{ receiver }}">
 <input type="hidden" id="chat_id" name="variable" value="{{ chat_id }}">
<div class="top-bar">
  <div class="back-button">
     <a href="{% url 'friends' %}">
        <button ><i class="fa fa-arrow-left"></i></button>
     </a>
</div>
  <div class="name-and-status">
     <div class="name">
        {{receiver}}
     </div>
     <div class="status">
        Online
     </div>
     <div class="chat-id">
        Chat ID : {{chat_id}}
     </div>
  </div>
</div>
<br><br>
<div class="chat-body-outer">
  <div class="chat-bubbles-body">
     <!--The Bubble Body-->
  </div>
</div>
<div class="chat-entry">
  <form id="message-form">
     <div class="input-box">
        <input type="text" name="" class="chat-entry-input-box" id="message-input"
             placeholder="Type your message here.. .">
     </div>
     <div class="send-button">
        <button type="submit" id="send" >
           <i class="fa fa-paper-plane"></i>
        </button>
     </div>
  </form>
</div>
<br>
<script src="https://code.jquery.com/jquery-3.2.1.min.js" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/crypto-js/3.1.9-1/crypto-js.js"
                                                                                                     30
  crossorigin="anonymous"></script>
  <script src="{% static "chat/scripts/chat.js" %}"></script>
  <script type="text/javascript">
       var input = document.getElementById("message-input");
       input.addEventListener("keyup",function(event){
       if(event.keyCode === 13){
           event.preventDefault();
           document.getElementById("send").click();
         }
       })
  </script>
  </body>
  </html>
Lets code the backend of our chat service which will interact with the existing frontend and it will
integrate the spam detector for filtering out the spam messages from our chat box.
#!usr/bin/python
def receivemsg(request):
return render(request,'account/dashboard.html',{'section':'dashboard'})
except KeyError:
return render(request,'account/dashboard.html',{'section':'dashboard'})
return JsonResponse({"access":"denied"})
def sendmsg(request):
def readmsg(request):
  chat_id = Followers.objects.filter(chat_id = request.GET.get('chat_id'))
  messages = ReadMessages.objects.filter(chat_id = chat_id[0]).order_by('time_date')
  messages = messages[max(0 , len(messages)-30):]
  response = {
     'status':'success',
     "messages" : [],
     "length" : 0
  }
def checkspam(request):
  message = request.GET.get('message')
  status = (spam_detection.is_spam(message))
  return JsonResponse({'status':status})
                                                                                                               32
 Machine learning Model
This web application supports the feature of spam detection in which a spam message is being
prevented to send it to the user(receiver).
 Working:
   •   The sender types the message to send it to the receiver.
• Before sending the message, the model is used to detect the spam in the message
   •   With the help of this algorithm we find out if the message is spam or not. If the message
       is spam then it is blocked right away otherwise the message is send to the receiver.
 Algorithm used:
The algorithm used is, 'Logistic Regression'. The Logistic Regression is the appropriate regression
analysis to conduct when the dependent variable is dichotomous. Like all regression analyses, the
logistic regression is a predictive analysis. Logistic regression is used to describe data and to
explain the relationship between one dependent binary variable and one or more nominal, ordinal,
interval or ratio-level independent variables.
Since this algorithm figures out whether a message is spam or not (the dependent variable has only
two possible types either 1 and 0), therefore, the type of logistic regression that we are using known
as 'Binary Logistic Regression'.
 Dataset used:
The dataset used for testing and training have more than 5000 training examples. There are two
columns in the dataset file. The first column is of text where all the training examples are given and
second column is of spam where the value '0' means that the text is not spam and '1' means than the
text is spam.
                                                                                                   33
Implementation:
We have stored the dataset file on the pandas frameworks, we have also downloaded the stopword.
We have cleaned the data by removing the rows having missing values.
Cleaning:
                                                                                              35
Here, we have vectorized the text we got using count_vectorizer and the created a vector space
model then we have split it to train 80% of the data that we got from vector space model and the
remaining 20% data is used for the testing purpose. After splitting the data we used logistic
regression algorithm to train the model and later tested the model.
Report:
                                                                                             36
The achieved accuracy is 0.98 out of 1.0
                                           37
 Steganography:
Steganography is the technique of hiding secret data within an ordinary, non-secret, file or message
in order to avoid detection; the secret data is then extracted at its destination. The use of
steganography can be combined with encryption as an extra step for hiding or protecting data.We
have used the PNG image files and WAV audio files as a cover to hide the data.
       Algorithm used: LSB Algorithm (Naive): In this algorithm, the least significant bit of the
   pixel is changed to hide the information. Here is its implementation.
 from PIL import
 Image import string
 import random
 dic= string.ascii_letters+string.punctuation+string.digits
 print(dic)
 def
     generate_message(n
     ): s = ""
     for i in range(n):
         s+=dic[random.randint(0 ,
     1000)%len(dic)] return s
 img =
 Image.open("0.png")
 img.show()
 def
     listoflist(l
     ): op=[]
     for i in l:
         op.append(list(i))
     return op
 def
     preprocessimage(listofpixels):
     for i in
     range(len(listofpixels)):
         for j in range(3): listofpixels[i]
             [j]&=254
 listofpixels =
 list(img.getdata())
 #print(listofpixels)
 listofpixels =
 listoflist(listofpixels)
 print(listofpixels[:10])
 preprocessimage(listofpixels)
 print(listofpixels[:10])
 message = generate_message(1000)
 listofbytes = [ord(i) for i in
 message] lis = []
 for i in
     listofbytes:
     while i:
         lis.append(i&254
         ) i>>=1
 listofbytes = lis[:]
 def hide(listofpixels ,
     listofbytes): key=[]
     k=0
     for i in
         range(len(listofpixels)):
         for j in range(3):
             try:
                 listofpixels[i][j]|
                 =listofbytes[k] k+=1
             except
                 IndexError:
                 break
 hide(listofpixels,listofbytes)
 print(listofpixels[:10])
 def
     listoftuple(l
                                                                                                 38
Input Image:
                                       39
Output Image:
This algorithm works fine but sometimes it also distorts the image to a noticeable extent
and to overcome this flaw, we have used another algorithm known as 'Battle Steg
Algorithm'.
                                                                                            40
from PIL import
Image import string
import
random
import
pickle
dic=
string.ascii_letters+string.punctuation+string.digits
print(dic)
def
    generate_message(n
    ): s = ""
    for i in range(n):
        s+=dic[random.randint(0 , 1000)%len(dic)]
    return s
img =
Image.open("2.png")
img.show()
def
    listoflist(l
    ): op=[]
    for i in l:
        op.append(list(i
    )) return op
def
    preprocessimage(listofpixels):
    for i in
    range(len(listofpixels)):
        for j in range(3):
            listofpixels[i]
            [j]&=254
listofpixels =
list(img.getdata())
#print(listofpixels)
listofpixels = listoflist(listofpixels)
print(listofpixels[:10])
preprocessimage(listofpixels)
print(listofpixels[:10])
message = generate_message(25)
print("message generated is :
",message) listofbytes = [ord(i) for
i in message] lis = []
print(listofbytes)
for i in
listofbytes:
    for k in
        range(8):
        lis.append(i
        %2) i//=2
listofbytes =
lis[:]
print(listofbytes)
def next_position(key,n):
    pos = (random.randint(0, n-1) , random.randint(0,2))
    return pos if pos not in key else
    next_position(key,n)
def hide(listofpixels ,
    listofbytes): key=[]
    n = len(listofpixels)
    for k in
        range(len(listofbytes)):
        i,j = next_position(key ,
        n) key.append((i,j))
        listofpixels[i][j]^=listofbytes[k]
    return key
key =
hide(listofpixels,listofbytes)
print(listofpixels[:10])
                                                           41
def
    listoftuple(l
    ): op=[]
    for i in l:
        op.append(tuple(i
    )) return op
new_image = Image.new(img.mode , img.size)
                                             42
listofpixels =
listoftuple(listofpixels)
new_image.putdata(listofpixels)
new_image.show()
new_image.save("0bs.png")
f =
open("key.pickle","wb")
pickle.dump(key,f)
new_image=None
new_image =
Image.open("0bs.png") msg=[]
list_of_pixels_in_new_image =
list(new_image.getdata()) for i,j in key:
    msg.append(str(list_of_pixels_in_new_image[i]
[j]&1)) print(msg)
msg = "".join(msg)
msg = msg[::-
1] ans=[]
print(msg)
for i in range(0,len(msg),8):
    ans.append(int(msg[i:i+8],2
    ))
for i in
    range(len(ans)):
    ans[i] =
    chr(ans[i])
msg = "".join(ans)
print(msg[::-1])
Input Image:
                                                              44
Snapshot
                                                      45
 Figure 5.5.3 Follow Activity Code
                                      46
Figure 5.5.5 Battle-Steg Algorithm Code
                                          47
Figure 5.5.6 Base of Frontend
                                48
Figure 5.5.8 Decision Tree Implementation
                                            49
           Figure 5.5.9 Email Verification
                                                         50
Figure 5.5.11 Front end Registration code
                                            51
Figure 5.5.13 Spam Detection Code
                                    52
Figure 5.5.15 Registration verification code
                                               53
Figure 5.5.17 Chat and Spam Bubble at Client Side
                                                    54
                                         CHAPTER 6
                                           TESTING
The quality of any web service or software depends on testing i.e. whether it is tested properly or
not. As testing is a process of executing an application or program of finding the software bugs
(errors or other defects). It can also be started as the process of validating and verifying that an
application meets the business and technical requirements that guided its design and development.
Software testing involves the execution of a software component or system component to one or
more properties of interest. In general, these properties indicate the extend which the component or
system under test:
As the number of possible tests for even simple software components is practically infinite, all
software testing uses some strategy to select tests that are feasible for the available time and
resources. As a result, software testing typically (but not exclusively) attempts to execute a program
or application with the intent of finding software bugs (errors or other defects).
 The job of testing is an iterative process as when one bug is fixed, it can illuminate other, deeper
bugs, or can even create new ones.
 Software testing can provide objective, independent information about the quality of software
and risk of its failure to users or sponsors.
A fundamental problem with software testing is that testing under all combinations of inputs and
preconditions (initial state) is not feasible, even with a simple product. This means that the number
of defects in a software product can be very large and defects that occur infrequently are difficult to
find in testing. More significantly, non-functional dimensions of quality (how it is supposed to be
versus what it is supposed to do)—
Software developers can't test everything, but they can use combinatorial test design to identify
the minimum number of tests needed to get the coverage they want. Combinatorial test design
enables users to get greater test coverage with fewer tests. Whether they are looking for speed or
test depth, they can use combinatorial test design methods to build structured variation into their
test cases.
                                                                                                        55
    Description of Agile Model
Agile software development refers to software development methodologies centered round the idea
of iterative development, where requirements and solutions evolve through collaboration between
self-organizing cross-functional teams. The ultimate value in Agile development is that it enables
teams to deliver value faster, with greater quality and predictability, and greater aptitude to respond
to change.
   •   While the team needs to stay focused on delivering an agreed-to subset of the product’s
       features during each iteration, there is an opportunity to constantly refine and reprioritize the
       overall product backlog.
   •   New or changed backlog items can be planned for the next iteration, providing the
       opportunity to introduce changes within a few weeks.
                                                                                                     56
 Types of Testing
There are mainly two types of testing:
This method is named so because the software program, in the eyes of the tester, is like a black box;
inside which one cannot see. This method attempts to find errors in the following categories:
    • Incorrect or missing functions
    • Interface errors
    • Errors in data structures or external database access
One advantage of the black box technique is that no programming knowledge is required.
Whatever biases the programmers may have had, the tester likely has a different set and may
emphasize different areas of functionality.
On the other hand, black-box testing has been said to be "like a walk in a dark labyrinth without a
flashlight. Because they do not examine the source code, there are situations when a tester writes
many test cases to check something could have been tested by only one test case, or leaves some
parts of the program untested.
                                                                                                  57
 White Box Testing
White-box testing (also known as clear box testing, glass box testing, transparent box testing, and
structural testing) is a method of testing software that tests internal structures or workings of an
application, as opposed to its functionality (i.e. black-box testing).
In white-box testing an internal perspective of the system, as well as programming skills, are used
to design test cases. The tester chooses inputs to exercise paths through the code and determine the
appropriate outputs.
White box testing is a method of testing the application at the level of the source code. These test
cases are derived through the use of the design techniques mentioned above: control flow testing,
data flow testing, branch testing, path testing, statement coverage and decision coverage as well as
modified decision coverage.
White-box testing is the use of these techniques as guidelines to create an error free environment by
examining any fragile code.
Step 1 – Understand the functionality of the application through its source code. Having said that, it
simply means that the tester must be well versed with the programming language and other tools
and techniques used to develop the software.
Step 2– Create the tests and execute them. When we discuss about testing, “coverage” is the most
important factor. Here I will explain how to have maximum coverage in the context of White box
testing.
White-box testing's basic procedures involves the tester having a deep level of understanding of the
                                                                                                   58
source code being tested. The programmer must have a deep understanding of the application to
know what kinds of test cases to create so that every visible path is exercised for testing. Once the
source code is understood then the source code can be analyzed for test cases to be created.
These are the three basic steps that white-box testing takes in order to create test cases:
Processing involves performing risk analysis to guide whole testing process, proper test plan,
execute test cases and communicate results. This is the phase of building test cases to make sure
they thoroughly test the application the given results are recorded accordingly.
Output involves preparing final report that encompasses all of the above preparations and results.
                                                                                                    59
                                          CHAPTER 7
                                        CONCLUSION
Sending the messages to people and having conversations over text messages is very easy and free
these days. Using internet for conversations has always issue of privacy. Even nearly all the
messaging applications have their own way of providing their messaging services. With the help of
your devices which have functionality to access the internet and have a browser, you can access this
web application for free and from any part of the world.
Although messaging services have been there from a long time but we came with exclusive features
that any other platform do not have. There is use of cover to hide every message (which is
encrypted before hiding it on the cover). We have also acknowledged the fact that anything
connected to the internet is vulnerable to hacking. So even if someone hacked and tried to read
messages, they would not be able to because:
1. They will get the cover as it is sent over the internet.
2. Cover is made secure using steganography and cryptography algorithm.
We have used the cryptography and steganography to provide the security for the user's messages.
This project is designed to block the spammy materials so this web application is suitable for your
kids as well. It blocks all the spammy messages using machine learning algorithm.
The web application is useful for the kids, parents and for anyone who don't wants spam in their
messages and wants security of their contents. The web application is free and it does not take any
additional devices to access, just your everyday devices like phones, laptops, tablets can be used to
access the web application.
This web application can be used in everyday messaging and it is simple in a way that everyone can
use it in just few seconds.
    Future Scope
.
Future scope for this web application consists of making the service even smarter to block spams
and other messages that consist of internet hate, bullying messages etc. Also making the web
application more secure and adding various innovative features and keeping up with changing
technologies and time. This way the service will get better and better with the time.
                                                                                                  60
    Uses & Targets
Since the concept of web applications and messaging services is so broad, it is almost impossible to
come up with a detailed specification of what a system for what the service will be able to do. As
has been stated before, the main purpose is to provide secured messaging service that can block the
spam messages so the user get quality with the service.
There are every other messaging services that uses various methods of securing the user's chat but
most of them are being compromised with the hackings.
We are not denying the fact that any of the services on the internet can be compromised and to
overcome with that we are using steganography concepts and algorithm in addition to the
cryptography concepts and algorithms to make messaging even more secure. There will always be a
cover with encrypted messages. The message is placed in cover in a way that it is hard to identify
where it is placed as the cover do not get distorted so much and looks very similar to cover without
anything hidden into it.
Anyone can use this web service and with growing time, this web application will become even
more user friendly.
Applications
This thesis set out to analyze the background and necessary conditions for success in the area of
internet messaging services. Furthermore, an analysis of the current state of the market and
development was to be made, and future trends to be extrapolated.
Finally, a prototype was to be created to show the possibilities in the area. The background
concludes that both the technology of the market and the potential customers should be ready to use
the service as a natural next step in the development. In the current development, two groups could
be discerned. The first one is younger users preferably kids, to make service better while
considering them. Surely, we need better understanding of kids, their psychology and the type of
services that help them grow and do not harm their mental health.
The other group have people other than the first group to make service better by focusing on user
                                                                                                 61
friendliness, security and not letting spams bother them while using the service.
Based on the analysis, this thesis focused on a simple, yet powerful solution that would allow the
users to have a secured service with providing quality in conversations.
Limitations
•    The analysis of background and current and future development is quite shallow due to the time
     limitations. In order to get a better analysis, more information gathering, surveys and interviews
     would have to be conducted.
•    The application is only available as a website and can only be accessed with a web browser. In
     future we might consider a mobile application as well.
•    This, of course, also affects our design choices for the service, but the most fundamental
     assessments in that area should be correct. We are always prepared to come up with better
     solutions and to know what the customer actually wants irrespective of what we expected that a
     customer wants.
• This web application needs internet access every time and will not work without internet.
•    In order to use the service, one must be registered with the website. It is for security purpose
     which cannot be compromised.
•    The ability to use your custom covers is not given as of now but you can always choose our
     default covers., also we will be adding more covers in the upcoming time.
                                                                                                    62
                               REFERENCES
[1] Holovaty, A., & Kaplan-Moss, J. (2009). The definitive guide to Django:
    Web development done right. Apress.
[2] Rish, I. (2001, August). An empirical study of the naive Bayes classifier. In IJCAI
    2001 workshop on empirical methods in artificial intelligence (Vol. 3, No. 22, pp. 41-
    46).
[3] Chandramouli, R., & Memon, N. (2001, October). Analysis of LSB based image
    steganography techniques. In Proceedings 2001 International Conference on Image
    Processing (Cat. No. 01CH37205) (Vol. 3, pp. 1019-1022). IEEE.
[4] Hussain, M., & Hussain, M. (2013). A survey of image steganography techniques.
[5] Agrawal, A., & An, A. (2012, December). Unsupervised emotion detection from text
    using semantic and syntactic relations. In 2012 IEEE/WIC/ACM International
    Conferences on Web Intelligence and Intelligent Agent Technology (Vol. 1, pp. 346-
    353). IEEE.
[6] Johnson, N. F., & Jajodia, S. (1998). Exploring steganography: Seeing the
    unseen. Computer, 31(2), 26-34.
[7] Cox, I., Miller, M., Bloom, J., Fridrich, J., & Kalker, T. (2007). Digital
    watermarking and steganography. Morgan kaufmann.
[8] Low, S., & Wilson, G. (2003). U.S. Patent Application No. 10/136,022.
[9] Gordon, A. T. (1997). U.S. Patent No. 5,608,786. Washington, DC: U.S. Patent
    and Trademark Office.
[10] Safavian, S. R., & Landgrebe, D. (1991). A survey of decision tree classifier
    methodology. IEEE transactions on systems, man, and cybernetics, 21(3), 660-674.
[11] Kleinbaum, D. G., Dietz, K., Gail, M., Klein, M., & Klein, M. (2002). Logistic
    regression. New York: Springer-Verlag.
63