A Course Based Project on
STEGANOGRAPHY
Submitted to the
Department ofECE
in partial fulfillment of the requirements for the completion of coursePYTHON PROGRAMMING
AND PRACTICE (22SD5DS203)
BACHELOR OF TECHNOLOGY
in
ELECTRONIC AND COMMUNICATION ENGINEERING
Submitted by
S ameer 2071A04J0
2
V.Aditya Nihal 22071A04K0
V.Sai Pranavi 22071A04K1
Under the guidance of
Mr. B B Shabarinath
Ms. G. Sahitya (Course Instructors)
VALLURUPALLI NAGESWARA RAO VIGNANA JYOTHI INSTITUTE OF ENGINEERING &
TECHNOLOGY
An Autonomous Institute, NAAC Accredited with ‘A++’ Grade, NBAVignana Jyothi
Nagar, Pragathi Nagar, Nizampet (S.O), Hyderabad – 500 090, TS, India
2023-24
VALLURUPALLI NAGESWARA RAO VIGNANA JYOTHIINSTITUTE OF ENGINEERING &
T ECHNOLOGY
n Autonomous Institute, NAAC Accredited with ‘A++’ Grade, NBA
A
Vignana Jyothi Nagar, Pragathi Nagar, Nizampet (S.O), Hyderabad– 500 090, TS, India
2023-24
VALLURUPALLI NAGESWARA RAO VIGNANA JYOTHI INSTITUTE OF
ENGINEERING AND TECHNOLOGY
Department of Electronics and Communication Engineering
CERTIFICATE
This is to certify that the course-based project entitled “INVOICE GENERATOR” that is
being submitted by Sameer(22071A04J0) and V. Aditya Nihal(22071A04K0)
and V. Sai Pranavi(22071A04K1) for the fulfillment of PYTHON PROGRAMMING AND
PRACTICE (22SD5DS203) in II-year II semester of Bachelor of Technology in Electronics
and CommunicationEngineering,oftheVNRVJIET,Hyderabadduringtheacademicyear
2023- 2024 is a record of Bonafide work carried out by us under the guidance and
supervision of.
ourse Coordinator
C Course Coordinator HEAD OF THE DEPT
Mr. B Shabarinath Ms. G. Sahitya Dr. S. Rajendra
Assistant Professor Assistant Professor Prasad
Professor & Head
VNRVJIET, Hyd. VNRVJIET, Hyd. VNRVJIET, Hyd.
DECLARATION
We do declare that the course based project report entitled “ANALYZING NOISE IN ANALOG-TO-
DIGITAL CONVERTERS” submitted to the Department of Electronics and Communication Engineering,
VallurupalliNageswaraRaoVignanaJyothiInstituteofEngineeringandTechnology,Hyderabad,inpartial
fulfilmentoftherequirementsforcoursebasedprojectofAnalogandDigitalCommunicationsLaboratory
in II B.Tech. II Semester for the academic year 2023 - 2024.
Place: Hyderabad Date:
Student Name Roll No. Student Signature
1. Sameer 22071A04J0
2. V.Aditya Nihal 22071A04K0
3. V.Sai Pranavi 22071A04K1
Verified by:
r. B Shabarinath
M Ms. G. Sahitya
Assistant Professor Assistant Professor
VNRVJIET, Hyd. VNRVJIET, Hyd.
Date of Verification:
INTRODUCTION
Steganography,derivedfromtheGreekwords"steganos"meaning"covered"and"graphein"meaning"writing,"is
the practice of concealingmessagesorinformationwithinothernon-suspiciousdata.Unlikecryptography,which
merelyscramblesamessagetomakeitunreadabletounauthorizedparties,steganographyhidestheexistenceofthe
message itself. This ancient art has evolved significantly with the advent of digital technology, enabling the
embedding of secret data into digital files such as images, audio, video, and text documents. Modern
steganographic techniques can hide information in a way that is virtually undetectable to the naked eye, using
complexalgorithmsthatmanipulatetheleastsignificantbitsofafile,therebymakingitanessentialtoolforsecure
communication in various fields.
The primary application of steganography is in secure communication, where the goal is to transmit sensitive
information without arousing suspicion. For instance, digital watermarks are a form of steganography used to
protect intellectual property by embedding hidden data within multimedia files, indicating ownership or
authenticity.Additionally,itisemployedindataintegrityverification,covertoperations,andevenindigitalrights
management. However, the same attributes that make steganography avaluabletoolforlegitimatepurposesalso
makeitappealingformaliciousactivities,suchasconcealingmalwareorillicitcommunications.Assuch,ongoing
research and development in steganographic methods and countermeasures are crucial to balance its use for
security and to mitigate potential threats.
TABLE OF CONTENTS
S.no Contents Page no.
1 SOFTWARE USED 1
2 CODE AND EXPLANATION 1-10
3 WORKING 11
4 OUTPUT 11-12
5 CONCLUSION AND 12
REFERENCES
STEGANOGRAPHY
SOFTWARE USED:Python 3.6.0
CODE:
def encode_text_in_image(image_path, text, output_image_path):
image = Image.open(image_path)
image = image.convert('RGB')
pixels = list(image.getdata())
binary_text = ''.join(format(ord(char), '08b') for char in text)
binary_text += '00000000' # Add a delimiter to indicate end of text
encoded_pixels = []
text_index = 0
for pixel in pixels:
r, g, b = pixel
if text_index < len(binary_text):
r = (r & 0b11111110) | int(binary_text[text_index])
text_index += 1
if text_index < len(binary_text):
g = (g & 0b11111110) | int(binary_text[text_index])
text_index += 1
if text_index < len(binary_text):
b = (b & 0b11111110) | int(binary_text[text_index])
text_index += 1
encoded_pixels.append((r, g, b))
encoded_image = Image.new(image.mode, image.size)
encoded_image.putdata(encoded_pixels)
encoded_image.save(output_image_path)
def decode_text_from_image(image_path):
# Open the input image
image = Image.open(image_path)
image = image.convert('RGB')
pixels = list(image.getdata())
binary_text = ''
for pixel in pixels:
r, g, b = pixel
binary_text += str(r & 1)
binary_text += str(g & 1)
binary_text += str(b & 1)
decoded_text = ''
for i in range(0, len(binary_text), 8):
byte = binary_text[i:i+8]
if byte == '00000000': # Stop at the delimiter
break
decoded_text += chr(int(byte, 2))
return decoded_text
input_image_path = r'B:\python cbp\input_image.png'
encoded_image_path = r'B:\python cbp\encoded_image.png'
encode_text_in_image(input_image_path, 'Secret Message', encoded_image_path)
decoded_message = decode_text_from_image(r'B:\python cbp\encoded_image.png')
print(decoded_message)
WORKING:
The provided code implements a simple form of steganography, which involves encoding and decoding a secret text message
within an image. Here's a detailed explanation of how the code works:
Encoding Text in an Image
1. Function Definition:
encode_text_in_image
o The function takes three arguments:
▪ : Path to the input image where the text will be encoded.
image_path
▪ : The secret message to be encoded.
text
▪ : Path to save the image with the encoded message.
output_image_path
2. Opening and Preparing the Image
o The image is opened and converted to the RGB color mode, ensuring compatibility with the encoding
process.
3. Extracting Pixels
o The pixels of the image are extracted into a list.
4. Converting Text to Binary
o The secret message is converted into a binary string. Each character of the text is transformed into its 8-bit
binary representation.
o An additional '00000000' binary sequence is appended to the end of the binary text as a delimiter to indicate
the end of the message.
5. Encoding Process
o Initialize an empty list
encoded_pixelsto store the modified pixels.
o Iterate over each pixel in the original image:
▪ Extract the red, green, and blue (RGB) values of the pixel.
▪ Modify the least significant bit (LSB) of each RGB component to store the bits of the binary text.
▪ If there are more bits of the binary text to encode, continue modifying the next color component.
o Append the modified pixel to
.
encoded_pixels
6. Creating and Saving the Encoded Image
o Create a new image with the same mode and size as the original.
o Replace the pixel data with the encoded pixels.
o Save the encoded image to the specified output path.
Decoding Text from an Image :
1. Function Definition:
decode_text_from_image
o The function takes one argument:
▪ : Path to the encoded image from which the text will be decoded.
image_path
2. Opening and Preparing the Image
o The encoded image is opened and converted to RGB mode.
3. Extracting Pixels
o The pixels of the image are extracted into a list.
4. Decoding Process
o Initialize an empty string
binary_textto store the binary bits extracted from the pixels.
o Iterate over each pixel in the image:
▪ Extract the least significant bit of each RGB component and concatenate them to .
binary_text
5. Converting Binary to Text
o Initialize an empty string
decoded_textto store the decoded message.
o Iterate over the
binary_textin chunks of 8 bits:
▪ Convert each 8-bit chunk to its corresponding character.
▪ Stop if the delimiter '00000000' is encountered.
o Append each character to
.
decoded_text
6. Returning the Decoded Text
o The function returns the decoded text message.
INPUT IMAGE:
ENCODED IMAGE:
OUTPUT:
APPLICATIONS
Steganographyhasvariousapplications,bothlegitimateandpotentiallymalicious,dependingonthecontext.Here
are some common applications of steganography:
Secure Communication:
Concealingmessageswithinimages,audio,orothermediatosecurelytransmitinformationwithoutattracting
attention.
Digital Watermarking:
Embedding hidden information (watermark) within multimedia files to prove ownership or authenticate the
source of the content. This is commonly used in images, videos, and audio.
Copyright Protection:
Protectingintellectualpropertybyembeddinginformationindigitalcontenttotrackandidentifyunauthorized
use or distribution.
Covert Communication:
Facilitating covert communication in situations where secrecy is crucial. This application is often seen in
intelligence and military operations.
Information Hiding:
Concealingsensitivedatawithinseeminglyinnocuousfilestoavoiddetection.Thiscanbeusedtohidedata
in plain sight.
Steganographic File Systems:
Creating file systems that use steganography to hide the existence of files or directories. This can be
employed for covert storage.
Social Media Security:
Concealing information within images or posts on social media platforms for secure communication or to
share information discreetly.
FUTURE SCOPE OF IMAGE PROCESSING:
Several potential developments and areas of interest can be identified:
Adoption in Emerging Technologies:
With the proliferation of emergingtechnologiessuchasaugmentedreality(AR),virtualreality(VR),
and the Internet of Things (IoT), there may be new opportunities for steganography to secure and
transmit information in these contexts.
Integration with Artificial Intelligence (AI):
TheintegrationofsteganographywithAItechniquescouldleadtomoreadaptiveandintelligenthiding
methods.AIcouldbeusedtodynamicallyadjuststeganographicparametersbasedonthecharacteristics
of the carrier and the detection methods employed.
Quantum Steganography:
As quantum computing technologies advance, there may be developmentsinquantumsteganography.
Quantum key distribution and other quantum communication principles could be integrated with
steganographic techniques to enhance security.
Biometric Steganography:
Steganographycouldbeappliedtohidebiometricdatawithinmultimediafilesforsecureauthentication
and identification. This may find applications in areas such as secure access control and identity
verification.
Deep Learning in Steganalysis:
As steganographic methods become more sophisticated,sotoowillthemethodsofsteganalysis.Deep
learning and machine learning techniques may beincreasinglyemployedtodetecthiddeninformation
within carriers.
Real-Time Communication Security:
The integration of steganography into real-time communication platforms, such asmessagingappsor
video conferencingtools,couldbecomemoreprevalent.Thiscouldofferusersameanstosecuretheir
communication in a seamless and unobtrusive manner.
CONCLUSION:
Inconclusion,steganographystandsasapowerfultoolintherealmofsecurecommunication,offeringa
uniqueapproachtosafeguardinginformationbyhidingitsveryexistencewithininnocuouscarrierslike
images, audio files, and other digital media. Unlike traditional cryptography, which focuses on
encrypting the content, steganography provides an additional layer of security by ensuring that the
presence of the message is undetectable to unintended recipients. This dual-layered approach makes
steganographyinvaluableforvariousapplications,fromprotectingintellectualpropertyandmaintaining
privacy to facilitating covert operations. However,thesamecharacteristicsthatmakesteganographya
robust security measure also posechallenges,asitcanbeexploitedforillicitpurposes.Astechnology
advances, the ongoing development of sophisticated steganographic techniques and corresponding
detection methods remains crucial. Balancing its legitimate uses with preventive measures against
misuse is essential to harness the full potential of steganography in a responsible and secure manner.
However, the dual nature of steganography raises ethical and legal considerations. While it can be a
valuabletoolforprivacy,security,andauthentication,itcanalsobemisusedforillicitpurposes,suchas
hiding malware or facilitating covert operations. Striking a balance between the legitimate use of
steganography and preventing its misuse is crucial in the evolving landscape of information security.
REFERENCES:
● https://pythongeeks.org/invoice-generator-with-python/
● https://practicalpython.yasoob.me/chapter3
● https://chatgpt.com/c/a1bc3660-9035-4b9f-b366-9b2240d09e23
● https://www.rawpixel.com/search/png?page=1&path=_topics&sort=curated
● https://ieeexplore.ieee.org/document/9335027
● h
ttps://www.researchgate.net/publication/348769709_Image_Steganography_A_Review_of_the_Recent_
Advances