Professional Documents
Culture Documents
Project Name
"Steganography"
BY
2023
1|Page
ti
Acknowledgement
We would like to express our gra tude to the following individuals
who have contributed to the development of this so ware project:
• Thanks all for providing valuable insights and feedback
throughout the project.
• Thanks to all for their technical exper se and assistance in
troubleshoo ng.
• Thanks to all for their support and encouragement throughout
the development process.
• Thanks to all for their contribu on to the design and user
interface of the so ware.
• Thanks to all for their assistance in tes ng and debugging the
so ware.
All the help and support that we have received during the project
implementa on is very much appreciated and it is the reason we
were nally able to present our idea and make it real, hoping it helps
many people out there.
2 | Page
ft
fi
ti
ti
ti
ft
ti
ti
ti
ti
ti
ti
ft
Abstract
Text hiding in images, audio, and video using cryptography is a technique
known as steganography. It involves embedding a message or data within
an image, audio le, or video in a way that is not apparent to the viewer
or listener. The goal is to hide the data in plain sight, so that it can be
transmi ed without detec on.
3 | Page
fi
ft
ti
tt
fi
ft
ft
ti
ti
fi
ti
fi
ti
fi
fi
ti
fi
ti
ti
fi
tt
fi
Table of Contents:
Contents
Chapter 1 ................................................................................................................................................................8
fi
ti
ti
ti
ti
ti
ti
ti
Chapter 5 ..............................................................................................................................................................45
Chapter 6 ..............................................................................................................................................................49
Chapter 7 ..............................................................................................................................................................85
Conclusion ........................................................................................................................................................85
References: ...........................................................................................................................................................87
5 | Page
ft
ti
ti
ti
ti
ti
ti
ti
ti
ti
ti
ti
List of gures:
Figure 1: Audio Steganography .............................................................................................................................11
6 | Page
fi
ti
7 | Page
Chapter 1
1.1 Introduc on
Overall, text hiding in images, audio, and video with cryptography and
decode and encode project is an important technique for securing data
transmission, and this project aims to develop a robust and secure system
for this purpose.
8 | Page
ti
ti
ti
ti
ti
ti
ti
tt
fi
ti
ti
fi
ti
ti
ti
tti
ti
ti
ti
ti
ti
ti
fi
ti
fi
ti
ti
ti
1.2 Problem De ni on
9 | Page
ti
ti
ti
ti
ti
tt
fi
ti
ti
fi
ti
ti
ti
tti
fi
ti
tt
ti
ff
ti
ffi
ti
ti
ti
tt
ti
ti
tt
ti
ti
ti
fi
Data Encryp on: The message to be hidden will be encrypted using a
symmetric or asymmetric encryp on algorithm to ensure that the
message is secure and cannot be accessed by unauthorized third par es.
ffi
ti
ti
tt
fi
ti
fi
fi
tt
ti
fi
ti
ti
fi
fi
fi
ti
tt
ti
ti
1.5 Advantages
2. C o v e r t c o m m u n i c a o n : T h e u s e o f s t e g a n o g r a p h y
techniques allows for covert communica on, where the hidden
data is not detectable without the proper decryp on key.
11 | Page
fi
ti
ffi
tt
ti
ti
ti
ti
ti
ti
ti
tt
ti
fi
ti
ti
ffi
tt
3. Robustness against a acks: The system is designed to withstand
various a acks, including sta s cal a acks and visual a acks that
can reveal the presence of the hidden data.
6. Versa lity: The system can be used to hide data within images,
audio, and video les, providing versa lity in the types of media
that can be used for covert communica on.
Chapter 2
Survey & Historical Data
2.1 Historical data
12 | Page
ffi
fi
ti
tt
ti
tti
ffi
fi
ti
ti
fi
tt
ti
ti
ti
ti
fi
tt
ti
ti
fi
ff
ti
tt
fi
1985 by a group of researchers at the University of Southern California, who
introduced the concept of least signi cant bit (LSB) steganography.
Today, steganography techniques con nue to evolve, with new methods being
developed to improve the security and e ciency of hiding data within media
les. The use of cryptography in steganography techniques has become
increasingly popular, providing an addi onal layer of security for hidden data.
ti
ti
fi
fi
ti
ti
ffi
fi
fi
fi
ti
tti
ti
ti
ti
fi
ti
ti
ft
image within another image le. It aims to provide an addi onal
layer of security by making the hidden image undetectable without
the proper decryp on key.
Chapter 3
So ware life cycle & Analysis
3.1 Project Development Methodology (phases):
15 | Page
ft
ti
ft
ti
ti
ti
fi
ff
ti
ti
ti
ti
ti
ti
4. Tes ng: The tes ng phase involves tes ng the system to ensure
that it meets the requirements and func ons correctly. This
includes tes ng the system's func onality, performance, and
security.
16 | Page
ti
fi
ti
fl
ti
ft
ti
ti
ti
ti
ti
ti
ti
ti
ti
fi
fi
fi
fi
ti
ti
ti
ti
ti
ti
ti
fi
fi
ti
ti
ti
requirements, is secure and e cient, and provides a user-friendly
interface. The methodology also ensures that the system is maintainable
and scalable, enabling it to adapt to changing requirements and
technologies.
3.2 Planning
5. Tes ng: Test the system to ensure that it meets the requirements
and func ons correctly. This includes tes ng the system's
func onality, performance, and security.
17 | Page
fi
ti
ti
ti
ti
ti
ti
ti
fi
ti
fi
ffi
ti
ti
ti
ti
8. Risk Management: Iden fy and mi gate risks that could a ect the
success of the project.
3.3 Analysis
18 | Page
fi
ti
fi
ti
ti
ti
ti
ti
fi
ti
ti
ff
ti
ft
ti
ti
ti
ti
ti
ti
ti
tf
ti
ff
• The system must be developed using programming languages and
frameworks suitable for steganography and cryptography
techniques.
• The system must be able to run on mul ple pla orms, including
Windows, macOS, and Linux.
• The system must be able to integrate with third-party libraries and
tools for steganography and cryptography techniques.
• Overall, the requirements analysis for text hiding in images, audio,
and video with cryptography and decode and encode project
ensures that the system meets the func onal and non-func onal
requirements of the stakeholders, is technically feasible, and meets
the opera onal requirements of the users. By de ning the
requirements, the project team can ensure that the system meets
the expecta ons of the stakeholders and users, providing a
valuable tool for securing the transmission of sensi ve informa on.
• Hardware
• Processor: Intel Core i5 or higher
• RAM: 8 GB or higher
• Hard Disk: 256 GB or higher
• Graphics Card: Nvidia GeForce GTX 1050 or higher
• Monitor: 1080p resolu on or higher
• So ware
• Opera ng System: Windows 10, macOS, or Linux
• Development Environment: Visual Studio Code, Eclipse, or
JetBrains IntelliJ IDEA
19 | Page
ft
ti
ti
ti
ti
ti
ti
tf
ti
fi
ti
ti
20 | Page
fi
ti
fi
ft
ti
fi
fi
fi
tt
ffi
ti
ti
ti
fi
ti
ti
tt
fi
ti
tt
1. Senders: These are the users who want to hide their sensi ve
informa on within media les using steganography techniques and
encrypt the hidden data using cryptography. They will use the
system's user interface to select the media le and the message to
be hidden and specify the encryp on algorithm and key.
2. Receivers: These are the users who receive the media les and
need to extract the hidden data using the correct decryp on key.
They will use the system's user interface to select the media le
and provide the decryp on key to extract the hidden message.
3.3.5 Tools
2. FFMPEG: FFMPEG is a command-line tool that can be used for audio and video
processing. It provides a wide range of func ons that can be used for steganography
techniques, including audio and video encryp on.
21 | Page
ti
ti
fi
ti
ti
ti
ti
fi
fi
ti
ti
fi
Figure 7: FFMPEG program
3. PyCrypto: PyCrypto is a Python library that can be used for encryp on and
decryp on of data. It provides a wide range of cryptographic algorithms, including
symmetric and asymmetric encryp on, that can be used to encrypt the hidden data
within media les.
4. NumPy: NumPy is a Python library that can be used for numerical compu ng. It
provides a wide range of func ons that can be used for steganography techniques,
including image manipula on and data extrac on.
22 | Page
ti
fi
fi
ti
ti
ti
ti
ti
ti
ti
ti
Figure 9:Steghide
23 | Page
24 | Page
25 | Page
3.4.1.3 Level 1
26 | Page
Encrypt Receiver
Sender
27 | Page
The overall goal of the project is to develop a system that can encode and
decode text messages in images, audio, and video les using
cryptography. The primary objec ve is to ensure that text messages are
hidden in such a way that they cannot be detected by unauthorized
individuals.
1. Data Encoding and Decoding: The system should be able to encode text
messages into images, audio, and video les using cryptographic
techniques such as AES or RSA. Similarly, the system should be able to decode
the hidden messages from these les.
2. User Interface: The system should have a user interface that allows users to
input text messages to be encoded and to view the decoded messages. The
interface should also provide op ons for selec ng the type of le to be used
for encoding.
3. Security: The system should ensure the security and protec on of the text
messages using a strong encryp on algorithm. The system should also provide
a secure key management system to protect the encryp on keys.
4. File Management: The system should be able to manage the les used for
encoding and decoding. The system should maintain an organized database of
the les used for encoding and decoding.
5. Tes ng: The system should be tested to ensure that it meets the requirements
and speci ca ons of the project. The tes ng process should include func onal
tes ng, performance tes ng, and security tes ng.
28 | Page
ffi
ti
ti
fi
fi
ti
ti
ti
ti
ti
fi
ti
ti
ti
fi
ti
ti
ti
fi
ti
ti
fi
fi
ti
ti
fi
ti
fi
Chapter 4
Data Encryp on Techniques
4.1 Introduc on:
Data encryp on is a crucial process used to transform data from a readable format
into an unintelligible format, ensuring protec on against unauthorized access. In this
chapter, we will explore various encryp on techniques that are employed to secure data in
di erent contexts. Each technique plays a unique role in safeguarding sensi ve informa on
and maintaining data con den ality and integrity.
29 | Page
ff
ti
ti
ti
ti
ti
ti
fi
ti
ti
ti
ti
ti
ti
ti
ti
ti
ti
ti
AES has become the de facto encryp on standard for various applica ons,
including secure communica on, data storage, and protec ng sensi ve
informa on. It has been extensively analyzed and recognized by
cryptographic experts for its resistance to a acks and computa onal
e ciency.
2. Rivest–Shamir–Adleman (RSA):
To encrypt plain-text using RSA, the sender uses the recipient's public key
to transform the data into ciphertext. The encrypted ciphertext can only
be decrypted using the recipient's corresponding private key. This makes
RSA suitable for secure data exchange and digital signatures.
Both AES and RSA are highly secure encryp on algorithms but are used in
di erent scenarios. AES is symmetric, meaning the same key is used for
encryp on and decryp on, making it more e cient for bulk data
encryp on. RSA, on the other hand, is asymmetric, providing secure key
exchange and digital signatures but being slower for large-scale data
encryp on.
30 | Page
ffi
ffi
ff
ti
fi
ti
ti
ti
ti
ti
fi
ti
ti
ti
ti
ti
ffi
ti
ti
ti
ti
ti
ti
fi
ti
ti
ti
ti
tt
ti
ffi
ti
ti
ti
ti
ti
ti
ti
ff
ti
ti
ti
4.3 Communica ons Encryp on (SSL/TLS):
TLS is the successor to SSL and is an updated and more secure version of
the protocol. It provides similar func onality to SSL and is widely used to
secure internet communica on. The terms SSL and TLS are o en used
interchangeably, although TLS is the more current and recommended
protocol.
31 | Page
ti
ti
ti
ti
ti
ti
ti
ti
ti
ti
ti
ti
tt
ti
ti
ffi
ti
ti
ti
ti
fi
fi
ti
ti
ti
ti
ti
fi
fi
ti
ti
ti
ti
fi
ft
ti
ti
ti
ti
ti
ti
POP), le transfer (FTP), and virtual private networks (VPNs). It protects
sensi ve data, such as login creden als, nancial informa on, and
personal data, from unauthorized access during transmission.
Websites and online services u lize SSL/TLS cer cates issued by trusted
cer cate authori es (CAs) to establish their server's authen city. This
allows clients to verify the iden ty of the server and ensure that their
communica on is encrypted and secure.
When sending an encrypted email using PGP, the sender's email client
encrypts the message using a randomly generated symmetric key. This key
is then encrypted using the recipient's public key, making it accessible
only to the intended recipient. The encrypted message and the encrypted
symmetric key are then sent to the recipient, who uses their private key
to decrypt the symmetric key and subsequently decrypt the message.
PGP also supports the use of digital signatures to verify the authen city
and integrity of email messages. The sender can digitally sign the message
using their private key, and the recipient can verify the signature using the
sender's public key. This ensures that the message has not been tampered
with during transit and originates from the expected sender.
ti
ti
ti
ti
ti
ti
ti
ti
ti
ti
ti
ti
ti
ti
ti
fi
tt
fi
ti
fi
ti
ti
ti
ti
ti
ti
ti
S/MIME also supports digital signatures, where the sender can sign the
email using their private key. The recipient can then verify the signature
using the sender's public key, con rming the authen city and integrity of
the message.
Both PGP and S/MIME are widely used to secure email communica ons,
especially when sending sensi ve or con den al informa on. They
provide end-to-end encryp on, ensuring that the content of the email
remains secure even if intercepted during transit. Addi onally, the use of
digital signatures helps verify the iden ty of the sender and detect any
tampering with the message.
ti
ti
ti
ti
ti
ti
ti
fi
ti
ti
fi
ti
ti
ti
ti
fi
fi
ti
ti
ti
ti
ti
ti
There are two common types of hard drive encryp on:
Full Disk Encryp on, as the name suggests, encrypts the en re contents
of the hard drive. It uses encryp on algorithms to transform the data into
an unreadable form, and only authorized users with the encryp on key or
password can decrypt and access the data.
FDE provides strong protec on for data at rest and ensures that even if
the hard drive is removed or stolen, the data remains encrypted and
inaccessible without the encryp on key.
Hard drive encryp on protects data from various threats, including the ,
unauthorized physical access, or unauthorized access through malware or
34 | Page
ti
fi
ti
ti
ti
fi
ti
ti
ti
ti
ti
ti
ti
ti
ti
ti
ti
tt
ti
ti
fi
ti
ti
fi
ft
fi
ti
ti
ti
ti
ti
ti
ti
ft
fl
ti
ti
ti
ti
fi
ti
ft
fl
fi
ft
ti
fi
ft
hacking. It is commonly used in laptops, desktop computers, and external
storage devices to safeguard sensi ve informa on.
Full device encryp on, similar to full disk encryp on for computers,
encrypts the en re storage of the mobile device. This includes the
opera ng system, applica ons, user data, and any addi onal storage
media, such as SD cards. All data is automa cally encrypted and
decrypted as needed when the user interacts with the device.
35 | Page
fi
ti
ti
ti
ti
ti
fi
ti
ti
ti
ti
ti
ti
ti
fi
ti
ti
ti
ti
ti
ti
ti
ti
ti
fi
ti
ti
ti
fi
ti
ti
ti
ti
ti
fi
ti
fi
ti
ti
ti
ti
Mobile devices o en include addi onal security features like secure boot
and tamper resistance. Secure boot ensures that the device's so ware
has not been tampered with or modi ed, preven ng unauthorized access
to the encryp on keys. Tamper resistance protects the encryp on keys
from being extracted or manipulated by physical a acks, such as chip-
level tampering or reverse engineering.
It's worth no ng that most modern mobile opera ng systems, such as iOS
and Android, o er built-in encryp on features that users can enable to
secure their devices. These encryp on features are designed to be
transparent to users, ensuring data security without compromising
usability.
1. Authen ca on:
36 | Page
fi
ti
ti
ti
ti
ti
ti
ti
ti
ft
ti
ti
ti
fi
ff
ti
ti
ti
ft
ti
ti
ti
fi
ti
ti
tt
ti
ti
ti
ti
fi
ti
fi
ti
ti
ti
ti
tt
ti
ti
ti
fi
ti
ti
ti
ti
ft
ti
ti
Wireless networks u lize authen ca on protocols to verify the iden ty of
devices a emp ng to connect to the network. The most common
authen ca on protocol used in Wi-Fi networks is the Wi-Fi Protected
Access (WPA) protocol. WPA provides stronger security compared to its
predecessor, Wired Equivalent Privacy (WEP).
2. Encryp on:
There is also a newer and more secure protocol known as WPA3, which
provides enhanced security features. WPA3 uses stronger encryp on and
introduces addi onal measures to protect against common Wi-Fi security
vulnerabili es.
37 | Page
ffi
ti
ti
ti
ti
tt
ti
ti
ti
ti
tt
ti
ti
ti
ti
tt
ti
ti
ti
tt
ti
ti
ti
ti
ti
ti
fi
ti
ti
ti
ti
ti
complex, unique passphrases to strengthen the security of their networks.
Regularly upda ng Wi-Fi devices and routers with the latest rmware and
security patches is also crucial to address any poten al vulnerabili es.
ti
ti
ti
ti
ti
ti
ti
ti
ti
ti
ti
ft
ti
ti
ffi
ft
ti
fi
ti
ti
ti
ti
ti
ti
ti
ti
ti
ti
fi
fi
ti
ti
ft
ft
39 | Page
tt
ti
ti
ft
ft
tf
fi
ti
ft
ti
ti
ti
ti
ti
ft
ti
ti
ti
ti
ti
ft
ft
ti
ti
tt
ti
ft
ft
fi
ft
ti
ti
ti
ti
ti
ti
fi
ft
ft
ti
ti
ti
ft
ti
ti
ti
ti
ti
ti
ti
fi
ti
ft
ti
a. Key Management by the CSP: The CSP generates and manages the
encryp on keys on behalf of the user. The encryp on process and key
management are transparent to the user, who can access the data using
their authen ca on creden als.
b. Bring Your Own Key (BYOK): With BYOK, the user generates and
manages their encryp on keys externally. The keys are securely provided
to the CSP, who uses them for data encryp on and decryp on. This
approach allows users to retain control over their encryp on keys and
ensures that the CSP cannot access the encrypted data without the user's
keys.
40 | Page
ti
ti
ti
ti
ti
ti
ti
ti
ti
ti
ti
ti
ti
ti
ti
ti
ti
ti
ti
ti
ti
ti
ti
ti
ti
ti
ti
ti
ti
ti
ti
ti
ti
ti
ti
ti
ti
ti
fi
ti
ti
ti
ti
ti
ti
ff
ti
ti
ti
fi
ti
ti
ti
ti
fi
fi
ti
ti
ti
ti
ti
ti
ti
ti
between endpoints remains encrypted and protected from eavesdropping
or unauthorized manipula on.
4. Watermarking:
It's important to note that media encryp on alone does not protect
against all poten al threats. Other security measures, such as secure
transmission protocols, user authen ca on, and secure storage of
encryp on keys, should be implemented to ensure comprehensive
protec on of media content.
Sensi ve data encryp on is a cri cal aspect of data protec on, focusing
speci cally on securing con den al and private informa on. Sensi ve
data includes personal iden able informa on (PII), nancial data,
42 | Page
ti
fi
fi
ti
ti
ti
ti
ti
ti
ti
ti
ti
ti
ti
ti
ti
ti
fi
ti
fi
ti
ti
ti
fi
ti
ti
ti
ti
ti
ti
fi
fi
ti
fi
ti
ti
ti
fi
ti
ti
ti
ti
ti
ti
healthcare records, and any other informa on that, if compromised,
could lead to severe consequences or privacy breaches.
ti
ti
ti
ti
ti
ti
ti
ti
ti
ti
ff
ti
ti
ti
ti
ti
ti
ti
fi
ti
ti
fi
ti
ti
ti
ti
ti
ti
ti
ti
ti
ti
ti
ti
ti
ti
ti
ti
ti
ti
ti
ti
fi
ti
fi
ti
ti
ti
ti
ti
ti
ti
accessing sensi ve data. MFA requires users to provide mul ple forms of
iden ca on, such as a password and a one- me passcode, ensuring that
only authorized individuals can decrypt and access sensi ve informa on.
44 | Page
ft
ti
fi
ti
ti
ti
fi
ti
ti
ti
ti
ti
ti
ti
fi
ti
ti
ti
ti
ti
ti
ti
ti
ti
ti
ti
ti
ti
ti
ti
ti
ti
ti
Chapter 5
5.1 Tools
45 | Page
ti
ti
ti
ti
ti
ti
ti
4. Mul media Libraries: Mul media libraries provide developers with the necessary
tools for manipula ng mul media les such as images, audio, and video les. Some
popular mul media libraries include OpenCV, FFmpeg, and PIL.
46 | Page
ti
ti
ti
ti
ti
fi
ti
fi
ti
7. Tes ng Frameworks: Tes ng frameworks provide developers with the necessary tools
for tes ng the applica on to ensure that it meets the requirements and
speci ca ons of the project. Some popular tes ng frameworks include JUnit, NUnit,
and PyTest.
It is important to note that these tools are not exhaus ve, and there may be other tools that
could be used to develop a desktop applica on for text hiding in images, audio, and video
with cryptography and decode and encode project. Addi onally, to avoid plagiarism, it is
important to use your own words and ideas when discussing tools and to properly reference
any sources used.
1. Encode Text into Mul media Files: The app should allow the user
to encode text messages into images, audio, and video les
using cryptographic techniques like AES or RSA.
2. Decode Text from Mul media Files: The app should allow the user
to decode hidden text messages from mul media les.
3. Select Mul media Files: The app should allow the user to select the
mul media les to be used for encoding and decoding.
47 | Page
ti
ti
fi
ti
ti
ti
ti
fi
ti
ti
ti
ti
ti
ti
ti
ti
ti
ti
ti
fi
fi
7. File Management: The app should be able to manage the les used
for encoding and decoding. The app should maintain an organized
database of the les used for encoding and decoding.
8. Security: The app should ensure the security and protec on of text
messages using a strong encryp on algorithm and by
implemen ng secure key management.
10. Help and Support: The app should provide users with help
and support op ons, such as a user manual, FAQs, or a support
cket system.
48 | Page
ti
ti
ti
ti
ti
ti
ti
fi
ti
fi
fi
ti
ti
ti
ti
ti
fi
ti
Chapter 6
System Implementa on
Introduc on:
The goal of this System Implementa on document is to provide a detailed descrip on of the
development process for a text hiding project in images, audio, and video with cryptography
and decode and encode func onality. The project aims to implement cryptography
techniques and algorithms to hide text messages in media les and provide the ability to
encode and decode the hidden messages.
The project will be developed using Python various libraries for image, audio, and video
processing. Cryptography techniques such as LSB encoding will be used to encode and
decode hidden messages in the media les. The resul ng applica on will be user-friendly
and secure, with features such as password protec on and encryp on.
This document will provide an overview of the project's design and architecture, as well as
detailed descrip ons of the encoding and decoding func onality for images, audio, and
video les. It will also cover the tes ng and quality assurance processes, including
the tes ng methodology and tools used for tes ng.
Overall, this System Implementa on document will serve as a comprehensive guide for the
development and implementa on of the text hiding project in images, audio, and video with
cryptography and decode and encode func onality.
49 | Page
ti
fi
ti
ti
ti
ti
ti
ti
ti
fi
ti
ti
ti
ti
ti
ti
fi
ti
ti
ti
Code of Video_steg:
This code is a Python script that imports the OpenCV library and several other
libraries to perform various tasks related to image and video processing.
Speci cally, it checks for the presence of an "audio.mp3" le, a "fps.txt" le,
and a "vid.txt" le, and deletes them if they exist. It also deletes any les or
folders in a "temp" directory.
The "os" and "shu l" libraries are used to interact with the le system and
delete les and folders. The "subprocess" library is used to execute external
commands, such as dele ng les or running other scripts.
The "img_steg" library is likely a custom library that contains func ons for
hiding data in images using steganography techniques.
50 | Page
fi
fi
fi
ti
ti
ti
fi
fi
ti
fi
fi
ti
fi
fi
fi
Overall, this code is a u lity func on that clears temporary les and folders to
ensure that the script can be run mul ple mes without interference from
previous runs.
51 | Page
fi
ff
ti
fi
ti
ff
ti
ff
ti
ti
ff
ti
ti
ff
fi
fi
fi
ti
The func on then uses the " probe" command to retrieve the frame rate
of the video le, and saves it to a le called "fps.txt". The frame rate is
extracted from the le and stored in a variable called "framerate".
The code then uses OpenCV to count the number of frames in the video
le by repeatedly calling the "read" method of a VideoCapture
object un l it returns False. The variable "totalNumberOfFrames" is
incremented for each successful read.
Overall, this code sets up the environment and gathers informa on about
the video le that will be used to perform steganography, which is the
hiding of data in the video le.
52 | Page
fi
ti
ti
fi
fi
fi
ti
fi
ff
fi
fi
ti
This code con nues the "stegVideo" func on and is responsible for spli ng the
input text message into smaller chunks and hiding each chunk in a video frame
using steganography.
The variable "chrIndex" is ini alized to 0, which will be used to keep track of
the index of the current character in the input text message. The variable
"chrPerFrame" is calculated to determine the number of characters that will be
hidden in each frame. This is done by dividing the total length of the text
message by the number of frames in the video, and then rounding up to the
nearest integer using the "math.ceil" func on.
The code then opens the video le using OpenCV's VideoCapture object and
loops through all of its frames. For each frame, a chunk of the input text
message is extracted using the "chrIndex" variable and the "chrPerFrame"
variable. The "encodeImage" func on is then called to embed the chunk of text
message into the frame using steganography. The modi ed frame is saved as
a PNG image le in a temporary directory.
The "window" and "progressbar" objects are updated to show the progress of
the steganography process.
Finally, the progress bar value is updated based on the number of frames
processed so far, to give the user an indica on of how much of the video le
has been processed.
53 | Page
fi
ti
ti
fi
ti
ti
ti
ti
fi
tti
fi
Figure 25:code 4 of Video_steg
This code de nes two func ons: "stegVideo" and "destegVideo". This explana on will focus
on the la er func on.
The "destegVideo" func on takes three parameters: a window object, a progressbar object,
and a target le path.
The func on rst sets the "FFPROBE_CMD" and "FFMPEG_CMD" variables to the default
values of " probe" and " mpeg", respec vely. If a subdirectory called " mpeg/bin" exists in
the current directory, the paths to the " probe" and " mpeg" executables are updated to
point to those les.
The func on then opens a le called "vid.txt" and uses the " mpeg" command to extract the
frames from the input video le and save them as PNG image les in a temporary directory.
The output of the " mpeg" command is redirected to the "vid.txt" le. The total number of
frames is extracted from the "vid.txt" le and stored in the variable "totalframes".
The func on then proceeds to extract the hidden text from the steganographic frames. This
is done by looping through each frame and calling the "decodeImage" func on to extract
the hidden text from the frame. The extracted text is appended to the "hiddentext" string.
54 | Page
ti
ti
tt
ti
ff
fi
fi
fi
fi
ti
ff
ti
ff
fi
ti
fi
fi
ti
ff
ff
ff
fi
fi
ff
ti
ti
This code is a con nua on of the "destegVideo" func on that extracts the hidden text from
the steganographic frames and returns the extracted text as a string.
The code rst nds the last occurrence of the string "frame=" in the "totalframes" variable
and adds 6 to the index to nd the star ng index of the frame count. It then nds the index
of the string "fps" to nd the end index of the frame count. The frame count is extracted as a
substring using the start and end indices, and converted to an integer. The value of
"totalframes" is updated to re ect the actual number of frames in the video.
The code then loops through each frame number and reads the corresponding PNG image
le from the temporary directory using OpenCV's "imread" func on. The "decodeImage"
func on is called to extract the hidden text from the image. If the extracted text is an empty
string, the loop is broken, as there is no more hidden text to extract. Otherwise,
the extracted text is appended to the "hiddentext" string.
The progress bar is updated to re ect the progress of the func on, and the temporary
les are deleted using the "clearTemp" func on.
Finally, the func on returns the "hiddentext" string, which contains all of the hidden text
extracted from the steganographic frames.
55 | Page
fi
fi
ti
fi
fi
ti
ti
fi
ti
fi
fl
fl
ti
ti
ti
ti
ti
fi
Code of Audio_steg:
This code de nes a func on called "stegAudio" that performs steganography on an audio
le. The func on takes ve parameters: a window object, a progressbar object, a target le
path, a cypher (text to hide), and a save loca on. The code rst opens the target audio
le using the "wave" library and converts the audio data to an array of bytes. It then
combines the input text message with a padding of "#" characters to ll the remaining space
in the audio le. The text message is then converted to a list of bits, with each character
represented as an 8-bit binary string. The code then loops through each audio sample in the
byte array and replaces the least signi cant bit with the corresponding bit from the input
text message. This is done by masking out the least signi cant bit using the logical AND
operator and then adding the corresponding bit from the input text message using the
logical OR operator.
56 | Page
fi
fi
fi
ti
fi
fi
ti
fi
ti
fi
fi
fi
fi
This code de nes a func on called "destegAudio" that extracts hidden text from an audio
le using steganography. The func on takes three parameters: a window object,
a progressbar object, and a target le path.
The func on rst opens the target audio le using the "wave" library and reads the audio
data as an array of bytes. It then loops through each byte in the array and extracts the least
signi cant bit of each byte using a bitwise AND opera on with the value 1 (i.e., "& 1"). The
resul ng bits are stored in a list called "extracted".
The extracted bits are then grouped into groups of 8 to reconstruct the original message.
This is done by conver ng the list of bits to a string and then spli ng the string into groups
of 8 using the "grouper" func on from the "itertools" library. Each group of 8 bits is then
converted to an ASCII character using the "chr" func on.
The resul ng string of ASCII characters is returned to the caller, and the progress bar value is
set to 100 to indicate that the func on has completed.
57 | Page
fi
fi
ti
ti
ti
fi
fi
ti
ti
ti
fi
ti
ti
fi
ti
ti
tti
This code is a con nua on of the "destegAudio" func on that extracts the hidden text from
the audio le using steganography.
The code rst extracts the least signi cant bit of each byte in the audio data array using
a bitwise AND opera on with the value 1 (i.e., "& 1"). The resul ng bits are stored in a list
called "extracted".
The code then joins the extracted bits into a string by conver ng every 8 bits into an ASCII
character using the "chr" func on, then joining all the resul ng characters together. This
creates a binary string that represents the hidden text message.
The binary string is then split at the "###" marker to remove any padding characters that
were added during the steganography process.
58 | Page
fi
fi
ti
ti
ti
ti
fi
ti
ti
ti
ti
Code of Image_steg:
60 | Page
fi
ti
ti
ti
ti
ti
character into its corresponding 8-bit ASCII binary representa on. If the
input is a byte array or numpy array, each element is converted into its
corresponding 8-bit binary representa on. If the input is an integer or
uint8, it is converted directly into its 8-bit binary representa on. The
func on returns the binary message.
The "decodeMsg" func on takes a binary data string as input, splits it into
groups of 8 bits, and converts each group into its corresponding ASCII
character. The func on stops decoding once the delimiter string ("#####")
is encountered.
61 | Page
ti
ti
ti
ti
ti
ti
fi
ti
ti
ti
ti
fi
ti
ti
ti
ti
fi
ti
ti
ti
ti
ti
Overall, this code provides func ons for encoding and decoding messages
within images using steganography with the least signi cant bit
technique. The "messageToBinary" func on converts the input message
to binary format. The "encodeImage" func on encodes the message into
the image by replacing the least signi cant bit of each color channel. The
"decodeMsg" func on decodes binary data strings into ASCII text.
Finally,the "decodeImage" func on extracts the hidden message from the
steganographic image by extrac ng the least signi cant bit of each color
channel and decoding the resul ng binary data string.
62 | Page
ti
ti
ti
ti
ti
ti
fi
ti
ti
ti
fi
ti
fi
Code of VideoSteg:
63 | Page
64 | Page
65 | Page
66 | Page
67 | Page
68 | Page
69 | Page
70 | Page
71 | Page
72 | Page
73 | Page
74 | Page
75 | Page
76 | Page
77 | Page
78 | Page
79 | Page
80 | Page
81 | Page
82 | Page
83 | Page
84 | Page
Chapter 7
Conclusion
In conclusion, a desktop applica on for text hiding in images, audio, and video with
cryptography and decoding and encoding project is an important tool for protec ng
sensi ve informa on. The project involves developing an app that can encode text messages
into images, audio, and video les using cryptographic techniques like AES or RSA, and then
decode hidden text messages from those les.
The design phase of the project involves de ning the architecture, components, modules,
interfaces, and data for the system to meet the project's requirements. The app should have
a user-friendly interface that allows users to input text messages to be encoded and
decoded. The app should also provide op ons for selec ng the type of le to be used for
encoding and decoding, and secure key management to protect the encryp on keys used.
Developers can use various tools such as programming languages, IDEs, cryptography
libraries, mul media libraries, UI frameworks, version control systems, and tes ng
frameworks to develop the app. The app should be tested thoroughly to ensure that it
meets the requirements and speci ca ons of the project.
Overall, developing a desktop applica on for text hiding in images, audio, and video with
cryptography and decode and encode project is a challenging but important task that
requires careful planning and implementa on. By implemen ng strong encryp on and
secure key management, the app can provide an e ec ve way to protect sensi ve
informa on.
Future work:
1. Mul -Pla orm Support: The desktop applica on could be expanded to support
mul ple pla orms such as Windows, Mac, and Linux.
2. Cloud Integra on: The app could be integrated with cloud storage
services like Dropbox, Google Drive, or OneDrive to easily store and share encrypted
mul media les.
85 | Page
ti
ti
ti
ti
ti
tf
tf
fi
ti
ti
ti
fi
fi
ti
ti
ti
fi
ti
ti
fi
ti
ti
ff
ti
ti
ti
fi
ti
ti
ti
ti
ti
5. Mul -Language Support: The app could be enhanced to support mul ple languages,
allowing users from di erent regions to use the app in their preferred language.
6. Machine Learning Integra on: The app could be integrated with machine learning
algorithms to automa cally detect and hide text messages in mul media les,
making the process more e cient and accurate.
8. Social Media Integra on: The app could be integrated with social media pla orms
like Facebook, Twi er, or Instagram to allow users to share encrypted mul media
les with their friends and family.
86 | Page
fi
ti
tt
ti
ff
ti
ti
ffi
ti
ti
fi
ti
ti
ti
tf
ffi
fi
References:
1. Mul -Pla orm Support: The desktop applica on could be expanded to
support mul ple pla orms such as Windows, Mac, and Linux.
2. Cloud Integra on: The app could be integrated with cloud storage
services like Dropbox, Google Drive, or OneDrive to easily store and
share encrypted mul media les.
5. Mul -Language Support: The app could be enhanced to support mul ple
languages, allowing users from di erent regions to use the app in their
preferred language.
6. Machine Learning Integra on: The app could be integrated with machine
learning algorithms to automa cally detect and hide text messages in
mul media les, making the process more e cient and accurate.
8. Social Media Integra on: The app could be integrated with social media
pla orms like Facebook, Twi er, or Instagram to allow users to share
encrypted mul media les with their friends and family.
87 | Page
tf
ti
ti
ti
tf
fi
ti
ti
ti
ti
tf
ti
ti
fi
ffi
ti
fi
tt
ti
ff
ffi
ti
ti
ti
fi
ti
9. Mul -Pla orm Support: The desktop applica on could be expanded to
support mul ple pla orms such as Windows, Mac, and Linux.
10.Cloud Integra on: The app could be integrated with cloud storage
services like Dropbox, Google Drive, or OneDrive to easily store and
share encrypted mul media les.
13.Mul -Language Support: The app could be enhanced to support mul ple
languages, allowing users from di erent regions to use the app in their
preferred language.
14.Machine Learning Integra on: The app could be integrated with machine
learning algorithms to automa cally detect and hide text messages in
mul media les, making the process more e cient and accurate.
16.Social Media Integra on: The app could be integrated with social media
pla orms like Facebook, Twi er, or Instagram to allow users to share
encrypted mul media les with their friends and family.
88 | Page
tf
ti
ti
ti
tf
fi
ti
ti
ti
ti
tf
ti
ti
fi
ffi
ti
fi
tt
ti
ff
ffi
ti
ti
ti
fi
ti