You are on page 1of 19

INFORMATION SECURITY Lab Project Report

On

“Image Steganography “

Submitted in Partial Fulfilment of the Requirements


For the award of the Degree of
Bachelor of Technology
In
Electronics & Computer Engineering (ECM)
By
P.SRAVANTHI 20311A1911
M.ADHVAITH 20311A1914
L.YASHWANTH 20311A1918
M.LAHARI 20311A1928

Under the Supervision of


Mrs. Voggu Soujenya

(Project Coordinator 1)

Mrs. K. Kusumalatha

(Project Coordinator 2)

Department of Electronics & Computer Engineering

1
Sreenidhi Institute of Science & Technology (Autonomous)
2022-2023
DEPARTMENT OF ELECTRONICS & COMPUTER ENGINEERING
SREENIDHI INSTITUTE OF SCIENCE AND TECHNOLOGY
(AUTONOMOUS)

CERTIFICATE

This is to certify that the INFORMATION SECURITY Project work entitled “Image

Steganography” submitted by 20311A1911,20311a1914,20311a1918,20311a1928

towards partial fulfilment for the award of Bachelor of Technology Degree in in

Electronics and Computer Engineering from Sreenidhi Institute of Science &

Technology, Ghatkesar, Hyderabad, is a record of bonafide work done by them during

the academic year 2022-2023 under our guidance and evaluation.

Lab Co-ordinator-1 Lab Co-ordimator-2

Mrs. Voggu Soujenya Mrs. K. Kusumalatha

Dr.D. Mohan
HOD, ECM Dept.

2
DECLARATION

This is to certify that the INFORMATION SECURITY Lab Project Report titled

“Image Steganography ”, is a record work done by us in the department of Electronics

and Computer Engineering (ECM), Sreenidhi Institute of Science & Technology,

Ghatkesar, Hyderabad.

The report is based on the project work done entirely by us and not copied from any

other source.

P.SRAVANTHI 20311A1911
M.ADHVAITH 20311A1914
L.YASHWANTH 20311A1918
M.LAHARI 20311A1928

3
ACKNOWLEDGMENT

I wish to express immense gratitude to my supervisors Mrs.Voggu Soujenya assistant


professor and Mrs. K. Kusumalatha assistant professor, ECM Department, for their
guidance and useful suggestions, which helped us in completing our Project Work in
time. Their valuable suggestions and comments towards this IS project have been very
much helpful in tackling various obstacles and accomplishing the major tasks.

I take immense pleasure in thanking HOD Dr.D. MOHAN, Principal Dr. Ch. Shiva
Reddy and our Executive Director C.V TOMYand all faculty members of ECM
department for having permitted me to carry out this Lab Project work.

NAME OF STUDENT (ROLL NO.)

P.SRAVANTHI 20311A1911

M.ADHVAITH 20311A1914

L.YASHWANTH 20311A1918

M.LAHARI 20311A1928

4
ABSTRACT

The word steganography means” covered in hidden writing”. The object of steganography is to
send a message through some innocuous carrier (to a receiver while preventing anyone else
from knowing that a message is being sent to all. Computer based steganography allows changes
to be made to what are known as digital carriers such as images or sounds .The changes
represent the hidden message, but result if successful in no discernible change to the carrier.
The information may be nothing to do with the carrier sound or image or it might be
information about the carrier such as the author or a digital watermarking or fingerprint
.In steganography information can be hidden in carriers such as images, audio files, text
files, and video and data transmissions. When message is hidden in the carrier a stego carrier
is formed for example a stego-image. Hopefully it will be perceived to be as close as
possible to the original carrier or cover image by the human senses. Images are the most
widespread carrier medium. The are used for steganography in the following way. The
message may firstly be encrypted. They are used for steganography in the following
way. The message may firstly be encrypted. The sender embeds the secret message to be sent
into a graphic file. This results in the production of what is called stego-image. Additional
secret data may be needed in the hiding process e.g. a stego-key etc. This stego-image
is then transmitted to the recipient

5
INDEX

S.NO CONTENT PAGE NUMBER

1 Introduction 7

2 Objective 8

3 Software and hardware Requirements 9

4 Implementation 10-15

5 Working 16

6 Results and outputs 17

7 Conclusion 18

8 References 19

6
CHAPTER-1
INTRODUCTION

Data hiding is of importance in many applications. For hobbyists, secretive data


transmission,
for privacy of users etc. the basic methods are: Steganography and Cryptography.
Steganography is a simple security method. Generally there are three different
methods used
for hiding information: steganography, cryptography, watermarking.
In cryptography, the information to be hidden is encoded using certain
techniques; this
information is generally understood to be coded as the data appears nonsensical.
Steganography is hiding information; this generally cannot be identified because
the coded
Detection of steganography is called Steganalysis.
Steganography is of different types:
1. Text steganography
2. Image steganography
3. Audio steganography
4. Video steganography
In all of these methods, the basic principle of steganography is that a secret
message is to be
embedded in another cover object which may not be of any significance in such a
way that the
encrypted data would finally display only the cover data. So it cannot be detected
easily to be
containing hidden information unless proper decryption is used.

7
CHAPTER-2
OBJECTIVE

Like many security tools, steganography can be used for a variety of reasons, some good,
some not so good.Legitimate purposes can include things like watermarking images for
reasons such as copyright protection. Digital watermarks (also known as
fingerprinting, significant especially in copyrighting material) are similar to
steganography in that they are overlaid in files, which appear to be part of the original
file and are thus not easily detectable by the average person.

Steganography can also be used as a way to make a substitute for a one-way hash value
(where you take a variable length input and create a static length output string to verify that
no changes have been made to the original variable length input).

Steganography can be used to tag notes to online images (like post-it notes attached to
paper files).

Steganography can be used to maintain the confidentiality of valuable information, to protect


the data from possible sabotage, theft, or unauthorized viewing. Steganography can
also be used for illegitimate reasons.

If someone was trying to steal data, they could conceal it in another file or files and
send it out in an innocent looking email or file transfer.

8
CHAPTER- 3

SOFTWARE AND HARDWARE REQUIREMENTS

Software Requirement
Microsoft windows 2000, XP, Vista, Windows 7 etc
Java Development Kit (jdk):1.4, 1.5

Hardware Requirements
Pc/AT 533 and above with MMX
64 MB RAM and above
Mouse or Pointing Devices
Minimum of 80 MB Hard Disk Space

9
CHAPTER 4

IMPLEMENTATION

CODE:

# Python program implementing Image Steganography

# PIL module is used to extract

# pixels of image and modify it

from PIL import Image

# Convert encoding data into 8-bit binary

# form using ASCII value of characters

def genData(data):

# list of binary codes

# of given data

newd = []

for i in data:

newd.append(format(ord(i), '08b'))

return newd

10
# Pixels are modified according to the

# 8-bit binary data and finally returned

def modPix(pix, data):

datalist = genData(data)

lendata = len(datalist)

imdata = iter(pix)

for i in range(lendata):

# Extracting 3 pixels at a time

pix = [value for value in imdata.__next__()[:3] +

imdata.__next__()[:3] +

imdata.__next__()[:3]]

# Pixel value should be made

# odd for 1 and even for 0

for j in range(0, 8):

if (datalist[i][j] == '0' and pix[j]% 2 != 0):

pix[j] -= 1

elif (datalist[i][j] == '1' and pix[j] % 2 == 0):

if(pix[j] != 0):
11
pix[j] -= 1

else:

pix[j] += 1

# pix[j] -= 1

# Eighth pixel of every set tells

# whether to stop ot read further.

# 0 means keep reading; 1 means thec

# message is over.

if (i == lendata - 1):

if (pix[-1] % 2 == 0):

if(pix[-1] != 0):

pix[-1] -= 1

else:

pix[-1] += 1

else:

if (pix[-1] % 2 != 0):

pix[-1] -= 1

pix = tuple(pix)

yield pix[0:3]

yield pix[3:6]
12
yield pix[6:9]

def encode_enc(newimg, data):

w = newimg.size[0]

(x, y) = (0, 0)

for pixel in modPix(newimg.getdata(), data):

# Putting modified pixels in the new image

newimg.putpixel((x, y), pixel)

if (x == w - 1):

x=0

y += 1

else:

x += 1

# Encode data into image

def encode():

img = input("Enter image name(with extension) : ")

image = Image.open(img, 'r')

data = input("Enter data to be encoded : ")

if (len(data) == 0):
13
raise ValueError('Data is empty')

newimg = image.copy()

encode_enc(newimg, data)

new_img_name = input("Enter the name of new image(with extension) : ")

newimg.save(new_img_name, str(new_img_name.split(".")[1].upper()))

# Decode the data in the image

def decode():

img = input("Enter image name(with extension) : ")

image = Image.open(img, 'r')

data = ''

imgdata = iter(image.getdata())

while (True):

pixels = [value for value in imgdata.__next__()[:3] +

imgdata.__next__()[:3] +

imgdata.__next__()[:3]]

# string of binary data

binstr = ''
14
for i in pixels[:8]:

if (i % 2 == 0):

binstr += '0'

else:

binstr += '1'

data += chr(int(binstr, 2))

if (pixels[-1] % 2 != 0):

return data

# Main Function

def main():

a = int(input(":: Welcome to Steganography ::\n"

"1. Encode\n2. Decode\n"))

if (a == 1):

encode()

elif (a == 2):

print("Decoded Word : " + decode())

else:

raise Exception("Enter correct input")

# Driver Code

if __name__ == '__main__' :
15
CHAPTER-5
WORKING
If two users exchanged media files over the internet, it would be more difficult to
determine whether these files contain hidden messages than if they were
communicating using cryptography.

Cryptography is often used to supplement the security offered by steganography.


Cryptography algorithms are used to encrypt secret data before embedding it into cover
files.

Image Steganography –

As the name suggests, Image Steganography refers to the process of hiding data within
an image file. The image selected for this purpose is called the cover image and the
image obtained after steganography is called the stego image.

How is it done?

An image is represented as an N*M (in case of grayscale images) or N*M*3 (in case
of color images) matrix in memory, with each entry representing the intensity value of
a pixel. In image steganography, a message is embedded into an image by altering the
values of some pixels, which are chosen by an encryption algorithm. The recipient of
the image must be aware of the same algorithm in order to know which pixels he or
she must select to extract the message.

16
CHAPTER-6
RESULTS AND OUTPUT

17
CHAPTER-7
CONCLUSION
Image Steganography. Images are an excellent medium for concealing
information because they provide a high degree of redundancy - which means that
there are lots of bits that are there to provide accuracy far greater than necessary for
the object's use (or display). Steganography techniques exploit these redundant bits to
hide the information/payload by altering them in such a way that alterations cannot be
detected easily by humans or computers. Color depth and definition. However, after
checking one million images, no hidden messages were found, so the practical use of
steganography still seems to be limited. Image Steganography is the technique of
hiding the data within the image in such a way that prevents the unintended user from
the detection of the hidden messages or data.

18
CHAPTER-8

REFERENCES

1.Johnson, Neil F. "Steganography."


Http://www.jjtc.com/pub/tr_95_11_nfj/sec101.html. N.p., Nov. 1995. Web.
2. Shikha, and Vidhu Kiran Dutt. "International Journal of Advanced
Research in
Computer Science and Software Engineering." Http://www.ijarcsse.com/. N.p., Sept.
2014. Web.

19

You might also like