Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 33

DECLARATION

We hereby declare that the project work entitled “IMAGE STEGANOGRAPHY”


submitted to JC Bose University of Science and Technology Faridabad, Haryana
(India), is a record of an original work done by us under the guidance of Dr. Ajit
Singh (Dean, FET) in Computer Science and Engineering, Bhagat Phool Singh
Mahila Vishwavidyalaya, Sonepat , and this project work is submitted in the
partial fulfillment of the requirements for the award of the degree of Bachelor of
Technology in COMPUTER SCIENCE AND ENGINEERING.

Page | II
CERTIFICATE

It is certified that the work contained in the project titled Shooter Game by Jahanvi has been
carried out under my guidance and that this work has not been submitted elsewhere for a degree.

Signature of Guide
Dr. Sunita Rani
Department of CSE/IT
BPSMV

Page | III
ACKNOWLEDGEMT

This work is just not an individual contribution till its completion. I take
this opportunity to express a deep gratitude towards my teacher, for
providing excellent guidance encouragement and inspiration throughout the
training work without his invaluable guidance, this work would never have
been a successful one.

I wish to express my sincere thanks to all department faculties and staff


members for their support.
I would also like to thank all my classmates for their valuable guidance and
helpful discussion.

Last but not the least, we wish to thank our parents for financing our studies in
this college as well as for constantly encouraging us to learn engineering. Their
personal sacrifice in providing this opportunity to learn engineering is
gratefully acknowledged.

Page |
IV
TABLE OF CONTENTS

Serial No. Content Page No.

1 Introduction 6–7

2 System Analysis 8–9

3 System Design 10 – 13

4 Testing and Test Results 14 – 16

5 System Implementation 17 – 29

6 Summary and Conclusions 30 – 33

7 References 34

Page | 5
INTRODUCTION

PROJECT SUMMARY
Steganography is the art of hiding information and an effort to conceal the existence of
the embedded information. It serves as a better way of securing message than
cryptography which only conceals the content of the message not the existence of the
message. Original message is being hidden within a carrier such that the changes so
occurred in the carrier are not observable. In this paper we will discuss how digital
images can be used as a carrier to hide messages. This paper also analyses the
performance of some of the steganography tools. Steganography is a useful tool that
allows covert transmission of information over an over the communications channel.
Combining secret image with the carrier image gives the hidden image. The hidden
image is difficult to detect without retrieval.

PURPOSE

In steganography, the possible cover carriers are


innocent looking carriers (images, audio, video, text, or
some other digitally representative code) which will
hold the hidden information. A message is the
information hidden and may be plaintext, cipher text,
images, or anything that can be embedded into a bit
stream. Together the cover carrier and the embedded
message create a stego-carrier. Hiding information may
require a stego key which is additional secret
information, such as a password, required for
embedding the information.
Fig.1
(The art of Steganography)

Page | 6
For example, when a secret message is hidden within a cover image, the resulting
product is a stego-image.
A possible formula of the process may be represented as:
cover medium + embedded message + stego key = stego-medium

Fig. 2
(Phase of Steganography)

OI: steganographic function "embedding"


SI: steganographic function "extracting"
Cover: cover data in which emb will be
hidden Emb: message to be hidden
Stego: cover data with the hidden message

SCOPE
Steganography can be a solution which makes it possible to send news and information
without being censored and without the fear of the messages being intercepted and
traced back to us. It is also possible to simply use steganography to store information on
a location. For example, several information sources like our private banking
information, some military secrets, can be stored in a cover source. When we are
required to unhide the secret information in our cover source, we can easily reveal our
banking data and it will be impossible to prove the existence of the military secrets
inside. Steganography can also be used to implement watermarking. Although the
concept of watermarking is not necessarily steganography, there are several
steganographic techniques that are being used to store watermarks in data. The main
difference is on intent, while the purpose of steganography is hiding information,
watermarking is merely extending the cover source with extra information.

Page | 7
SYSTEM ANALYSIS

USER CHARACTERISTICS

Analyzing repetitive patterns may reveal the identification of a steganography tool or


hidden information. To inspect these patterns an approach is to compare the original
cover image with the stegno image and note visible differences. This is called a known-
carrier attack. By comparing numerous images, it is possible that patterns emerge as
signatures to a steganography tool. Another visual clue to the presence of hidden
information is padding or cropping of an image. With some stegno tools if an image
does not fit into a fixed size, it is cropped or padded with black spaces. There may also
be a difference in the file size between the stegno-image and the cover image. Another
indicator is a large increase or decrease in the number of unique colors, or colors in a
palette which increase incrementally rather than randomly

Page | 8
HARDWARE AND SOFTWARE REQUIREMENT
HARDWARE SPECIFICATION
Processor Intel Pentium 4 or later
RAM 2 GB or more
Hard Disk 20 GB or more
Mouse Standard Mouse
Keyboard Standard Keyboard

SOFTWARE SPECIFICATION
Operating System Windows 7, Linux or later
Language Python 3
Libraries Used Numpy, Pandas, OS, Matplotlib, CV
IDE Jupyter Notebook

Page | 9
SYSTEM DESIGN

STUDY OF CURRENT SYSTEM

Unusual patterns in a stego image are suspicious. For example, there are some disk
analysis utilities that can filter hidden information in unused partitions in storage
devices. Filters can also be used to identify TCP/IP packets that contain hidden or
invalid information in the packet headers. TCP/IP packets used to transport information
across the Internet have unused or reserved space in the packet headers. Digital image
steganography and its derivatives are growing in use and application. In areas where
cryptography and strong encryption are being outlawed, citizens are looking at
steganography to circumvent such policies and pass messages covertly. As with the
other great innovations of the digital age: the battle between cryptographers and
cryptanalysis, security experts and hackers, record companies and pirates,
steganography and Steganalysis will continually develop new techniques to counter
each other.
The disabling or removal of hidden information in images is dependent on the image
processing techniques. For example, with LSB methods of inserting data, simply
compressing the image using lossy compression is enough to disable or remove the
hidden message. There are several available steganographic detection tools such as
Encase by Guidance Software Inc., ILook Investigator by Electronic Crimes Program,
Washington DC, various MD5 hashing utilities, etc.

Fig. 3 (Steganography Procedure)

Page | 10
PROBLEM AND WEAKNESSES OF CURRENT SYSTEM

Detection: Steganography can be detected if a person has the right tools and
techniques, so it is not a foolproof method of securing communication.
Complexity: Steganography can be complex and requires specialized tools and
knowledge to implement effectively.
Lengthy Transmission Time: Hiding data within an image can be a time- consuming
process, especially for large files, which can slow down the transmission of data.
Susceptibility to Data Loss: The hidden message may be lost or distorted during the
transmission or processing of the image, resulting in a loss of data. Misuse:
Steganography can be misused for illegal activities, including hiding malicious
code or malware within an image, making it difficult to detect and prevent
cybersecurity attacks.

REQUIREMENTS OF NEW SYSTEM

The detection of steganography software on a suspect computer is important to the


subsequent forensic analysis. As the research shows, many steganography detection
programs work best when there are clues as to the type of steganography that was
employed in the first place. Finding steganography software on a computer would give
rise to the suspicion that there are actually steganography files with hidden messages on
the suspect computer. Furthermore, the type of steganography software found will
directly impact any subsequent steganalysis (e.g., S-Tools might direct attention to GIF,
BMP, and WAV files, whereas JP Hide-&-Seek might direct the analyst to look more
closely at JPEG files).

STEGANOGRAPHIC MODEL

Fig. 4 (Steganography Model)

Page | 11
As found in the above picture, both the first picture file(X) and mystery message
(M) that should be covered up are taken care of into a steganographic encoder as info.
Steganographic Encoder work, f (X, M, K) inserts the mystery message into a spread
picture record by utilizing procedures like least critical piece encoding. The subsequent
stego picture looks fundamentally the same as your spread picture record, with no
obvious changes. These finishes encoding. To recover the mystery message, stego
object is taken care of into Steganographic decoder. This paper will assist you with
implementing picture steganography utilizing Python. It will assist you with composing
a Python code to conceal instant messages utilizing a procedure called Least Significant
Bit.

Least Steganographic Model

We can portray a computerized picture as a limited arrangement of advanced qualities,


called pixels. Pixels are the littlest individual component of a picture, holding esteems
that speak to the splendor of a given shading at a particular point. So, we can think
about a picture as a network (or a two-dimensional cluster) of pixels which contains a
fixed number of lines and sections. Least Significant Bit (LSB) is a strategy wherein the
last piece of every pixel is changed and supplanted with the mystery message’s
information bit.

Fig. 5.1
(RGB Pixel)

Fig. 5.2
(Bit Details)

Page | 12
From the above image it is clear that, if we change MSB it will have a larger impact on
the final value but if we change the LSB the impact on the final value is minimal, thus
we use least significant bit steganography.

How LSB Techniques Work

Every pixel contains three qualities which are Red, Green, Blue, these qualities run
from 0 to 255, at the end of the day, they are 8-piece esteems. Let’s take a case of how
this strategy functions, assume you need to shroud the message “howdy” into a 4x4
picture which has the accompanying pixel esteems:

[(225, 12, 99), (155, 2, 50), (99, 51, 15), (15, 55, 22), (155, 61, 87), (63, 30, 17),
(1, 55, 19), (99, 81, 66), (219, 77, 91), (69, 39, 50), (18, 200, 33), (25, 54, 190)]

Utilizing the ASCII Table, we can change over the mystery message into decimal
qualities and afterward into parallel: 0110100 0110101.Now, we repeat over the pixel
esteems individually, subsequent to changing over them to twofold, we supplant every
least noteworthy piece with that message bits successively The subsequent pixel
esteems in the wake of performing LSBS is as demonstrated as follows:

[(224, 13, 99), (154, 3, 50), (98, 50, 15),(15, 54, 23),(154, 61, 87),(63, 30, 17),(1,
55, 19),(99, 81, 66),(219, 77, 91),(69, 39, 50),(18, 200, 33),(25, 54, 190)]

Sampling Patterns

There are three sampling patterns available in H.264 that allow to reduce the amount of
stored chroma information: 4:4:4, 4:2:2 and 4:2:0. They are illustrated in Figure 4. 4:2:0
is most common since the human eye usually does not notice any difference to the
original image even though the number of chroma samples is reduced to a quarter.

Fig. 6
(Different sampling patterns)

Page | 13
TESTING

TESTING PLAN

Any system, to be successful, must be thoroughly tested, and well managed test plan
should be prepared before actual testing is being performed. “Modules” have been
developed and need to be tested in a manner that can reduce occurring of defects as low
as possible. Following are the activities we planned to test the system.

 This system is indeed an evolutionary system so every unit of the system is


continuously under testing phase.

 One test activity “Basis Path Testing” that will try to cover all paths in the
system. This activity identifies all paths that provide different functionality of the
system, and also other paths to reach at that functionality.

 Other testing activity is “Control Structure Testing”, which will test each and
every condition with positive and negative data combination.

 This testing activity will also perform “Data Floe Testing” in which it will be
tested how the data re following the system. And will also check whether the data
entered from one procedure, is reflected whenever it requires or not.

All conditions will be tested with “Boundary Value Analysis” where different input will
be given to test whether the system is functioning with boundary values or not.

TESTING STRATEGY

CONTENT TESTING:

Errors in Project content can be as trivial as minor typographical error as incorrect


information, improper organization or validation of intellectual property laws.

Page | 14
Content Testing attempt to uncover this and many other problems before the user
encounter them.

CONTENT TESTING OBJECTIVES

There are three types of objectives.


 To uncover syntactic errors in text-based documents, graphical representation and
other media.
 To uncover semantic errors in any content object represented as navigation error.
 To find errors in organization or structure of content that is presented to the end-
user

INTERFACE TESTING

Interface design model is reviewed to ensure that generic quality criteria established for
all user interfaces have been achieved and that application specific interface design
issue has been properly addressed.

INTERFACE TESTING STRATEGY:

The overall strategy for interface testing is to


(1) Uncover error related to specific Interface mechanisms
(2) uncover errors in the way the interface implements the semantics of navigation,
App functionality, or content display. To accomplish this strategy, a number of
objectives must be achieved Interface futures are tested to ensure that design rules,
aesthetics and related visual content are available for the user without error.

Fig. 9 (Analysis Diagram)

Page | 15
Fig. 11.1 Fig. 11.2
(Cover Image) (Stego Image)

Fig. 12.1 Fig. 12.2


(Histogram of Cover Image) (Histogram of Stego Image)

Page | 16
SYSTEM IMPLEMENTATION

SYSTEM CODING

import numpy as np import


pandas as pand import os
import cv2
from matplotlib import pyplot as plt

def txt_encode(text): l=len(text)


i=0 add='' while
i<l:
t=ord(text[i]) if(t>=32 and
t<=64):
t1=t+48
t2=t1^170 #170: 10101010
res = bin(t2)[2:].zfill(8) add+="0011"+res

else:
t1=t-48
t2=t1^170
res = bin(t2)[2:].zfill(8) add+="0110"+res
i+=1 res1=add+"111111111111"
print("The string after binary conversion appyling all the transformation :- " +
(res1))
length = len(res1)
print("Length of binary after conversion:- ",length)
HM_SK="" ZWC={"00":u'\u200C',"01":u'\u202C',"11":u'\u202D'
,"10":u'\u200E'}
file1 = open("Sample_cover_files/cover_text.txt","r+")
nameoffile = input("\nEnter the name of the Stego file after Encoding(with
extension):- ")
file3= open(nameoffile,"w+", encoding="utf-8") word=[]
for line in file1: word+=line.split()
i=0 while(i<len(res1)):
s=word[int(i/12)] j=0
x=""
HM_SK=""
while(j<12):
x=res1[j+i]+res1[i+j+1] HM_SK+=ZWC[x]
j+=2 s1=s+HM_SK
file3.write(s1) file3.write("
") i+=12
t=int(len(res1)/12) while
Page | 17
t<len(word):
file3.write(word[t]) file3.write("
") t+=1
file3.close() file1.close()
print("\nStego file has successfully generated")

def encode_txt_data(): count2=0


file1 = open("Sample_cover_files/cover_text.txt","r")
for line in file1:
for word in line.split(): count2=count2+1
file1.close() bt=int(count2)
print("Maximum number of words that can be inserted :- ",int(bt/6))
text1=input("\nEnter data to be encoded:- ") l=len(text1)
if(l<=bt):
print("\nInputed message can be hidden in the cover file\n")
txt_encode(text1) else:
print("\nString is too big please reduce string size")
encode_txt_data()

def BinaryToDecimal(binary): string =


int(binary, 2) return string

def decode_txt_data(): ZWC_reverse={u'\u200C':"00",u'\u202C':"01",u'\u20


2D':"11",u'\u200E':"10"}
stego=input("\nPlease enter the stego file name(with extension) to decode the
message:- ")
file4= open(stego,"r", encoding="utf-8") temp=''
for line in file4:
for words in line.split(): T1=words
binary_extract=""
for letter in T1:
if(letter in ZWC_reverse): binary_extract+=ZWC_reverse[lett
er]
if binary_extract=="111111111111": break
else:
temp+=binary_extract print("\nEncrypted message presented
in code

Page | 18
bits:",temp)
lengthd = len(temp)
print("\nLength of encoded bits:- ",lengthd) i=0
a=0
b=4
c=4
d=12
final=''
while i<len(temp):
t3=temp[a:b] a+=12
b+=12
i+=12
t4=temp[c:d] c+=12
d+=12 if(t3=='0110'):
decimal_data = BinaryToDecimal(t4) final+=chr((decimal_data ^
170) + 48)
elif(t3=='0011'):
decimal_data = BinaryToDecimal(t4) final+=chr((decimal_data ^
170) - 48)
print("\nMessage after decoding from the stego file:- ",final)

def txt_steg(): while


True:
print("\n\t\tTEXT STEGANOGRAPHY OPERATIONS")
print("1. Encode the Text message") print("2. Decode the
Text message") print("3. Exit")
choice1 = int(input("Enter the Choice:")) if choice1 == 1:
encode_txt_data() elif choice1
== 2:
decrypted=decode_txt_data() elif choice1 == 3:
break
else:
print("Incorrect Choice") print("\n")

def msgtobinary(msg): if type(msg)


== str:
result= ''.join([ format(ord(i), "08b") for i in msg ])

elif type(msg) == bytes or type(msg) == np.ndarray:


result= [ format(i, "08b") for i in msg ]

Page | 19
elif type(msg) == int or type(msg) == np.uint8: result=format(msg, "08b")

else:
raise TypeError("Input type is not supported in this function")

return result

def encode_img_data(img):
data=input("\nEnter the data to be Encoded in Image :")
if (len(data) == 0):
raise ValueError('Data entered to be encoded is empty')

nameoffile = input("\nEnter the name of the New Image (Stego Image) after
Encoding(with extension):")

no_of_bytes=(img.shape[0] * img.shape[1] * 3) //
8

print("\t\nMaximum bytes to encode in Image :",


no_of_bytes)

if(len(data)>no_of_bytes):
raise ValueError("Insufficient bytes Error, Need Bigger Image or give
Less Data !!")

data +='*^*^*'

binary_data=msgtobinary(data) print("\n")
print(binary_data)
length_data=len(binary_data)

print("\nThe Length of Binary data",length_data) index_data = 0

for i in img:
for pixel in i:

r, g, b = msgtobinary(pixel) if index_data <


length_data:
pixel[0] = int(r[:-1] + binary_data[index_data], 2)
index_data += 1
if index_data < length_data: pixel[1] = int(g[:-1] +
binary_data[index_data], 2)
index_data += 1
if index_data < length_data: pixel[2] = int(b[:-1] +
binary_data[index_data], 2)
index_data += 1
Page | 20
if index_data >= length_data: break
cv2.imwrite(nameoffile,img)
print("\nEncoded the data successfully in the Image and the image is
successfully saved with name ",nameoffile)

def decode_img_data(img): data_binary


= ""
for i in img:
for pixel in i:
r, g, b = msgtobinary(pixel) data_binary += r[-
1] data_binary += g[-1] data_binary += b[-1]
total_bytes = [ data_binary[i: i+8] for i in range(0,
len(data_binary), 8) ]
decoded_data = ""
for byte in total_bytes: decoded_data += chr(int(byte, 2))
if decoded_data[-5:] == "*^*^*":
print("\n\nThe Encoded data which was hidden in the
Image was :-- ",decoded_data[:-5])
return

def img_steg(): while


True:
print("\n\t\tIMAGE STEGANOGRAPHY OPERATIONS\n")

print("1. Encode the Text message") print("2. Decode the


Text message") print("3. Exit")
choice1 = int(input("Enter the Choice: ")) if choice1 == 1:
image=cv2.imread("Sample_cover_files/cove r_image.jpg")
encode_img_data(image) elif choice1
== 2:
image1=cv2.imread(input("Enter the Image you need to Decode
to get the Secret message : "))
decode_img_data(image1) elif
choice1 == 3:
break
else:
print("Incorrect Choice") print("\n")

def encode_aud_data(): import


wave

nameoffile=input("Enter name of the file (with extension) :- ")


song = wave.open(nameoffile, mode='rb')

nframes=song.getnframes() frames=song.readframes(nframes)
Page | 21
frame_list=list(frames) frame_bytes=bytearray(frame_list)

data = input("\nEnter the secret message :- ") res = ''.join(format(i, '08b') for i

in
bytearray(data, encoding ='utf-8'))
print("\nThe string after binary conversion :- "
+ (res))
length = len(res)
print("\nLength of binary after conversion :- ",length)

data = data + '*^*^*' result = []

for c in data:
bits = bin(ord(c))[2:].zfill(8) result.extend([int(b) for b in bits])

j=0
for i in range(0,len(result),1):
res = bin(frame_bytes[j])[2:].zfill(8) if res[len(res)-4]==
result[i]:
frame_bytes[j] = (frame_bytes[j] &
253) #253: 11111101
else:
frame_bytes[j] = (frame_bytes[j] & 253) |
2
frame_bytes[j] = (frame_bytes[j] & 254) |
result[i]

Page | 22
j=j+1

frame_modified = bytes(frame_bytes) stegofile=input("\nEnter name of the

stego file
(with extension) :- ")
with wave.open(stegofile, 'wb') as fd: fd.setparams(song.getparams())
fd.writeframes(frame_modified)
print("\nEncoded the data successfully in the audio file.")
song.close()

def decode_aud_data(): import


wave

nameoffile=input("Enter name of the file to be decoded :- ")


song = wave.open(nameoffile, mode='rb')

nframes=song.getnframes() frames=song.readframes(nframes)
frame_list=list(frames) frame_bytes=bytearray(frame_list)

extracted = "" p=0


for i in range(len(frame_bytes)):

if(p==1):
break
res = bin(frame_bytes[i])[2:].zfill(8) if res[len(res)-2]==0:
extracted+=res[len(res)-4] else:
extracted+=res[len(res)-1]

all_bytes = [ extracted[i: i+8] for i in range(0, len(extracted), 8) ]


decoded_data = ""
for byte in all_bytes:
decoded_data += chr(int(byte, 2)) if decoded_data[-5:]
== "*^*^*":
print("The Encoded data was :-- ",decoded_data[:-
5])
p=1
break

def aud_steg(): while


True:
print("\n\t\tAUDIO STEGANOGRAPHY OPERATIONS")
print("1. Encode the Text message") print("2. Decode the
Text message") print("3. Exit")
Page | 23
choice1 = int(input("Enter the Choice:")) if choice1 == 1:
encode_aud_data() elif
choice1 == 2:
decode_aud_data() elif
choice1 == 3:
break
else:
print("Incorrect Choice") print("\n")

def KSA(key):
key_length = len(key)
S=list(range(256)) j=0
for i in range(256):
j=(j+S[i]+key[i % key_length]) % 256

S[i],S[j]=S[j],S[i]
return S

def PRGA(S,n): i=0


j=0 key=[]
while n>0:
n=n-1 i=(i+1)%256
j=(j+S[i])%256
S[i],S[j]=S[j],S[i]
K=S[(S[i]+S[j])%256]
key.append(K) return
key

def preparing_key_array(s): return [ord(c) for c in


s]

def encryption(plaintext): print("Enter the key : ")


key=input() key=preparing_key_array(key)

S=KSA(key)

keystream=np.array(PRGA(S,len(plaintext))) plaintext=np.array([ord(i) for i in


plaintext])

cipher=keystream^plaintext ctext=''
for c in cipher: ctext=ctext+chr(c)
return ctext

Page | 24
def decryption(ciphertext): print("Enter the key : ")
key=input() key=preparing_key_array(key)

S[i],S[j]=S[j],S[i]
return S

def PRGA(S,n): i=0


j=0 key=[]
while n>0:
n=n-1 i=(i+1)%256
j=(j+S[i])%256
S[i],S[j]=S[j],S[i]
K=S[(S[i]+S[j])%256]
key.append(K) return
key

def preparing_key_array(s): return [ord(c) for c in


s]

keystream=np.array(PRGA(S,len(ciphertext))) ciphertext=np.array([ord(i) for i in


ciphertext])

decoded=keystream^ciphertext dtext=''
for c in decoded: dtext=dtext+chr(c)
return dtext

def embed(frame):
data=input("\nEnter the data to be Encoded in Video :")
data=encryption(data)
print("The encrypted data is : ",data) if (len(data) == 0):
raise ValueError('Data entered to be encoded is empty')

data +='*^*^*'

binary_data=msgtobinary(data) length_data =
len(binary_data)

index_data = 0 for i in

frame:
for pixel in i:
r, g, b = msgtobinary(pixel) if index_data <
length_data:
Page | 25
pixel[0] = int(r[:-1] + binary_data[index_data], 2)
index_data += 1
if index_data < length_data: pixel[1] = int(g[:-1] +
binary_data[index_data], 2)
index_data += 1
if index_data < length_data: pixel[2] = int(b[:-1] +
binary_data[index_data], 2)
index_data += 1
if index_data >= length_data:
break
return frame

def extract(frame): data_binary = ""


final_decoded_msg = "" for i in frame:
for pixel in i:
r, g, b = msgtobinary(pixel) data_binary += r[-
1] data_binary += g[-1] data_binary += b[-1]
total_bytes = [ data_binary[i: i+8] for i in range(0,
len(data_binary), 8) ]
decoded_data = ""
for byte in total_bytes: decoded_data += chr(int(byte, 2))
if decoded_data[-5:] == "*^*^*":
for i in
range(0,len(decoded_data)-5):
final_decoded_msg +=
decoded_data[i]
final_decoded_msg =
decryption(final_decoded_msg)
print("\n\nThe Encoded data which was hidden in the
Video was :--\n",final_decoded_msg)
return

def encode_vid_data(): cap=cv2.VideoCapture("Sample_cover_files/cover_vi


deo.mp4")
vidcap = cv2.VideoCapture("Sample_cover_files/cover_video.mp4"
)
fourcc = cv2.VideoWriter_fourcc(*'XVID') frame_width =
int(vidcap.get(3)) frame_height = int(vidcap.get(4))

size = (frame_width, frame_height)


out = cv2.VideoWriter('stego_video.mp4',fourcc, 25.0, size)
max_frame=0;
while(cap.isOpened()): ret, frame =
cap.read() if ret == False:
break
Page | 26
max_frame+=1
cap.release()
print("Total number of Frame in selected Video
:",max_frame)
print("Enter the frame number where you want to embed data : ")
n=int(input()) frame_number = 0
while(vidcap.isOpened()):
frame_number += 1
ret, frame = vidcap.read() if ret == False:
break
if frame_number == n: change_frame_with =
embed(frame) frame_ = change_frame_with
frame = change_frame_with
out.write(frame)

print("\nEncoded the data successfully in the video file.")


return frame_

def decode_vid_data(frame_):
cap = cv2.VideoCapture('stego_video.mp4') max_frame=0;
while(cap.isOpened()): ret, frame =
cap.read() if ret == False:
break
max_frame+=1
print("Total number of Frame in selected Video
:",max_frame)
print("Enter the secret frame number from where you want to extract data")
n=int(input())
vidcap = cv2.VideoCapture('stego_video.mp4') frame_number = 0
while(vidcap.isOpened()):
frame_number += 1
ret, frame = vidcap.read() if ret == False:
break
if frame_number == n:
extract(frame_) return

def main():
print("\t\t STEGANOGRAPHY")
while True:
print("\n\t\t\tMAIN MENU\n")
print("1. IMAGE STEGANOGRAPHY {Hiding Text in Image cover file}")
print("2. TEXT STEGANOGRAPHY {Hiding Text in Text cover
file}")
print("3. AUDIO STEGANOGRAPHY {Hiding Text in Audio cover file}")
print("4. VIDEO STEGANOGRAPHY {Hiding Text in Video cover file}")

Page | 27
print("5. Exit\n")
choice1 = int(input("Enter the Choice: ")) if choice1 == 1:
img_steg() elif
choice1 == 2:
txt_steg() elif choice1
== 3:
aud_steg() elif choice1
== 4:
vid_steg() elif choice1
== 5:
break
else:
print("Incorrect Choice") print("\n\n")

if name == " main ":


main()

Page | 28
OUTPUT

Page | 29
CONCLUSION
Steganography is the art of hiding information and an effort to conceal the existence of
the embedded information. It serves as a better way of securing message than
cryptography which only conceals the content of the message not the existence of the
message. Original message is being hidden within a carrier such that the changes so
occurred in the carrier are not observable. In this paper we will discuss how digital
images can be used as a carrier to hide messages. This paper also analyses the
performance of some of the steganography tools. Steganography is a useful tool that
allows covert transmission of information over an over the communications channel.
Combining secret image with the carrier image gives the hidden image. The hidden
image is difficult to detect without retrieval.

Steganography transmits secrets through apparently innocuous covers in an effort to


conceal the existence of a secret. Digital image steganography and its derivatives are
growing in use and application. In areas where cryptography and strong encryption are
being outlawed, citizens are looking at steganography to circumvent such policies and
pass messages covertly. As with the other great innovations of the digital age: the battle
between cryptographers and cryptanalysis, security experts and hackers, record
companies and pirates, steganography and Steganalysis will continually develop new
techniques to counter each other.

Page | 30
APPLICATION AREA
Here are some potential applications of steganography in a project report:

Digital Watermarking for Document Authentication:


Purpose: Embed a digital watermark within the document to verify its authenticity and prove
ownership.
Example: Embed a unique identifier or author information within the text or images of the
report.

Protection Against Plagiarism:


Purpose: Embed hidden information that identifies the original author or source of the document
to deter plagiarism.
Example: Encode authorship details within the document content to discourage unauthorized
use.

Securing Sensitive Information:


Purpose: Conceal sensitive or confidential information within the document for added security.
Example: Embed a hidden section containing confidential data or access credentials that can
only be extracted with the right method.

Embedding Metadata:
Purpose: Include metadata within the document for organizational or tracking purposes.
Example: Embed information about the project, authors, or version details within the document
for reference.

Interactive Content or Hyperlinks:


Purpose: Embed hidden hyperlinks or interactive content for additional resources or related
information.
Example: Encode URLs or links within the document that are not visible but can be extracted
for further exploration.

Hiding Revision History or Annotations:


Purpose: Conceal revision history or annotations within the document for a cleaner presentation.
Example: Embed information about changes, comments, or annotations in a way that is not
immediately visible but can be retrieved if needed.

Page | 31
Covert Communication in Collaborative Projects:
Purpose: Use steganography for covert communication within the document among
collaborators.
Example: Embed messages or comments within the text or images that are only visible to
specific collaborators who know the extraction method.

Enhancing Aesthetics with Hidden Artwork:


Purpose: Add hidden visual elements, such as images or artwork, to enhance the aesthetic
appeal of the report.
Example: Embed artwork within the document that is not immediately visible but can be
revealed with the appropriate method.

Creative Project Presentations:


Purpose: Use steganography for creative and engaging presentations by embedding hidden
content.
Example: Incorporate hidden messages or images that are gradually revealed during a
presentation for a dynamic and interactive experience.

Page | 32
FUTURE SCOPE

In the near future, the most important use of steganographic techniques will probably
be lying in the field of digital watermarking. Content providers are eager to protect
their copyrighted works against illegal distribution and digital watermarks provide a
way of tracking the owners of these materials.

Steganography might also become limited under laws, since governments already
claimed that criminals use these techniques to communicate.

The possible use of steganography technique is as following:


 Hiding data on the network in case of a breach.
 Peer-to-peer private communications.
 Posting secret communications on the Web to avoid transmission.
 Embedding corrective audio or image data in case corrosionoccurs from a poor
connection or transmission.

Page | 33
REFERENCES
 http://www.nicetext.com/doc/isc01.pdf
 http://www.beyonddiscovery.org/content/view.page.asp?I=1956, 2003 .

 Hiding in Plain Sight: Steganography and the Art of Covert Communication


Cole, Eric.
 http://www.computerworld.com/securitytopics/security/story/0,1
0801,71726,00.html

 https://en.wikipedia.org/wiki/Steganography

 https://www.youtube.com/watch?v=xepNoHgNj0w

 https://www.freecodecamp.org/news/what-is-steganography-hide-data-inside-
data

 https://www.wired.com/story/steganography-hacker-lexicon

Page | 34

You might also like