0% found this document useful (0 votes)
15 views21 pages

NIS Micro Project - 1

The document presents a micro-project on text steganography, detailing its definition, methods, advantages, and historical examples. It contrasts text steganography with cryptography, emphasizing the importance of concealing the existence of a message rather than just securing it. The project includes coding implementation examples in Python for encoding and decoding hidden messages within text.

Uploaded by

laxmangunge0
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
15 views21 pages

NIS Micro Project - 1

The document presents a micro-project on text steganography, detailing its definition, methods, advantages, and historical examples. It contrasts text steganography with cryptography, emphasizing the importance of concealing the existence of a message rather than just securing it. The project includes coding implementation examples in Python for encoding and decoding hidden messages within text.

Uploaded by

laxmangunge0
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 21

Kala Vidya Mandir Institute Of Technology

Department Of Computer Engineering

Micro - Project
On
Text Steganography

Submitted
By:
Laxman Nagnath Gunge 243214
Parina Shailesh Hedavkar 243215
Arya Mangesh Jadhav 243216
Bhumika Mukesh Jadhav 243217

For
Network and Information Security
(NIS 22620)

Faculty Name:
Mr. Deepak Kulkarni
Index
Sr No. Topic

1 Abstract

2 Introduction

3 What is Text Steganography?

4 Cryptography vs. Steganography: Difference

5 Historical examples of Steganography

6 Advantages of Text Steganography

7 Basic Concepts

8 Methods of Text Steganography

9 Coding Implementation

10 Disadvantages of Text Steganography

11 Concept of Stegoanalysis

12 Real-world Applications

13 Ethics of Using Steganography

14 Conclusion

15 References
Abstract
Steganography is the art of hiding information within other less
conspicuous information to prevent eavesdropping by way of hiding its
existence in the first place. Image-based steganography is the most common
form, but text-based steganography can also be used. Text-based
steganography can be generally classified as format-based, linguistic, and
random/statistical generation. In general, random and statistically generated
methods create a cover text but do not necessarily make semantic sense; that
is, the subject matter of each sentence has little or no relation to the next
sentence. Linguistic steganography can use natural language processing to hide
information, but again, it is still subject to analysis, particularly if the basis for
the cover text is an existing document. Here, we examine the leading methods
of text-based steganography. We evaluate a variety of steganographic
techniques, including open space encoding, synonym replacement, UK/US
English translation algorithm, and Wayner’s Mimic Functions using five
benchmarks which compare speed, capacity, complexity, compromisability, and
size. We find that the best methods to hide information should not use a single
scheme, but a hybrid of many schemes. To further hide information, text
should be compressed, encrypted, and then hidden in a cover document.
Introduction
Encryption of messages is now common (Gupta et al., 2016). Popular
applications include messaging, email, and website queries. Whilst we feel
pretty secure in the knowledge that encryption takes place, the very existence
of the encryption can alert network peers, rogue routers, and so forth to the
presence of hidden information. Steganography is the art of hiding information
inside a carrier such as an image, a sound file, or network packets. The field of
steganography has had much research, especially with image-based
steganography, but less research has taken place with text-based
steganography. Beyond email and watermarking, steganography has not
become mainstream, yet the purpose of steganography is not to secure
information as encryption but to hide its very existence in the first place. The
origins of steganography were first coined by Trithemius, who coined
‘steganographia’, which means ‘concealed writing’ (Bennett, 2004). Today,
steganography has been extended to include not only text but also
images and any other object. For example, text can be embedded in images,
video or other objects and vice versa with enough data to hide information in
steganography can fall into five categories: images, video, audio, text
(Bhattacharyya et al., 2010) and other objects such as executables which does
not fit into the four original categories that Bhattacharyya described.
What is Text Steganography?
Text Steganography is defined as a type of steganography which involves
caching dispatches or secret information within a textbook document or other
textual data. In this system, we try to hide secret data with the help of each
letter of the word. It is challenging to describe, especially when the variations
or changes made are subtle.

Cryptography vs. Steganography: What's the Difference?


Historical examples of Steganography

Invisible Ink:
• People have used invisible ink for centuries! They'd write messages with
substances like lemon juice or milk, which are invisible when dry. The
message would only appear when the paper was heated.
• This was used a lot in spy stories, and also in real life.
Microdots:
• During World War II, spies used tiny photographs called microdots to
hide messages. They could shrink a whole page of text down to the size
of a period, then hide it in a seemingly normal letter.
Null Ciphers:
• These are messages where the hidden text is within a larger body of text.
For example, as mentioned previously, taking the first letter of each word
in a normal-looking sentence to spell out a hidden message.
Tattooed Heads:
• In ancient Greece, a guy named Histiaeus shaved the head of his most
trusted servant, tattooed a secret message on his scalp, and then waited
for the hair to grow back. Once the hair was long enough, he sent the
servant to deliver the hidden message. This is a very interesting example
of hiding messages in plain sight.
Musical Steganography:
• Composers have even used music to hide messages! By subtly changing
the notes or rhythms, they could encode secret information. This is a
very complex form of steganography, but it shows how creative people
can be.
Pigeon Post:
• During wars, carrier pigeons were used to deliver messages. These birds
could carry tiny messages attached to their legs, and because they were
fast and reliable, they were hard to intercept. This is not strictly text
steganography, but it's a great example of hiding information during
transport.
Semagrams:
• This is a form of steganography that involves hiding messages in images
or other visual media. For example, patterns in a carpet, or the way
objects are arranged in a painting, could all hold a secret message.
The "Baconian Cipher":
• Developed by Francis Bacon, this method hides messages within a
seemingly normal text by using different fonts or styles of letters. For
example, using two different fonts to represent 0 and 1, and then using
those binary codes to represent letters.
Grille Ciphers:
• These involved using a cardboard template with holes cut in it. The
template was placed over a seemingly ordinary piece of text, and the
letters visible through the holes would form the hidden message. This
method required both the sender and receiver to have the same
template.
Morse Code in Knitting:
• During wartime, spies would sometimes knit messages into clothing
using Morse code. By varying the knit and purl patterns, they could
transmit secret information.
Hidden Messages in Art:
• Throughout history, artists have been known to hide secret symbols and
messages in their paintings. These could be religious symbols, political
messages, or even personal secrets.
Advantages of Text Steganography
Concealment:
• The biggest advantage is that it hides the very existence of a message. If
nobody knows a message is there, it's much harder to find! It's like
hiding a treasure in a book, instead of putting it in a treasure chest.
Discreet Communication:
• It allows people to share information without raising suspicion. Imagine
sending a message hidden in a regular email or document. It looks
completely normal!
Watermarking:
• Think of it like a secret signature. You can hide copyright information
inside a text file, so if someone tries to steal it, you can prove it's yours.
Bypassing Censorship:
• In places where information is controlled, people can use steganography
to sneak messages past censors. It's like hiding a note in a school
lunchbox to get around the teacher.
Increased Security (in some cases):
• Combined with cryptography, it can make messages even safer. First, you
scramble the message (cryptography), then you hide it (steganography).
It's like having a double lock on your door.
Simplicity:
• Some text steganography methods are very easy to use, even without
fancy computers. You can hide messages using just pen and paper!
Basic Concepts
Cover Text:
• Imagine you want to hide a little note for your friend. The "cover text" is
like the normal-looking letter or document you put your secret note
inside. It's the text that everyone else sees, and it looks completely
ordinary. For example, it could be a story, an email, or even a list of
groceries. It's just the text that's used to hide the secret message.
Secret Message:
• This is the actual information you want to keep hidden. It's the note
you're trying to sneak to your friend without anyone else knowing. It
could be anything: a word, a sentence, a number, or even a whole
paragraph. It's the information you're trying to hide within the cover
text.
Redundancy in Text:
• Think of "redundancy" as the extra, unnecessary parts of text that we
don't need. It's like having extra space in your backpack. For example:
o Extra spaces between words or at the end of lines.
o Slight variations in font or formatting.
o Words that could be replaced with synonyms without changing
the meaning.
• These extra bits are what we use to hide our secret message. It's like
using the space in your backpack to hide your secret note.
Payload:
• The "payload" is the actual size of the secret message that you can hide
inside the cover text. It is like, how much information you can put into
the cover text.
• For example, if you have a lot of extra spaces in your cover text, you can
hide a bigger secret message (a larger payload). If you only have a few
extra spaces, you can only hide a small message.
• It's like how much candy you can fit into your pocket. A bigger pocket
means a bigger payload of candy!
Methods of Text Steganography
1. Format-Based Methods: Hiding Messages in the Way Text Looks

Imagine you're trying to hide a note in a book. Instead of writing on the pages,
you could change how the pages look, right? That's what format-based
steganography does!
Extra Spaces:
• Imagine you want to hide a binary message (a message made of 0s and
1s). You could use one space to represent a "0" and two spaces to
represent a "1." So, if your secret message is "101," you'd add two
spaces, then one space, then two spaces into your cover text.
• This is simple, but it's also easy to spot if someone is looking closely.
Changing Line Spacing/Font Sizes:
• Computers can be very precise. They can change the height of lines by
tiny amounts that humans can't easily see. You could use these tiny
changes to represent bits of your secret message.
• Similarly, you could make some letters slightly bolder or slightly larger,
and use those changes to hide information.
Invisible Characters:
• Zero-width spaces are like tiny, invisible "spaces" that don't take up any
visible room. You can place them between letters or words, and they
won't change how the text looks.
• These characters can be used in combination to create a binary code
that, when decoded, reveals the hidden message.
2. Linguistic Methods: Hiding Messages in the Words Themselves

This is like using a secret language that only you and your friend understand.
Word Shifting:
• Think of it like using a thesaurus to find words with similar meanings. You
and your friend could agree on a system where certain synonyms
represent certain letters or numbers.
• For example, if you wanted to hide the word "code," you could use the
following. "Program, message, password, encrypt." Each of those words
could represent a letter.
Using Abbreviations or Acronyms:
• You could create a secret list of abbreviations and their meanings. For
example, "ASAP" might mean "attack at sunrise," and "FYI" might mean
"find the key."
• This works well if you have a limited number of secret messages you
want to send.
Creating a "Code" with Specific Words/Phrases:
• This method is very similar to using a code book. You and a friend decide
that certain words or phrases have hidden meanings.
• For example, you could say that every time the word "blue" is used, it
means to move the location of the secret meeting.
3. Statistical Methods: Hiding Messages in the Patterns of Text

This method is a little more advanced and uses math!


Using Word Length or Letter Frequency:
• Computers can analyze large amounts of text to find out how often
different letters and words are used. You can then slightly change the
letter or word usage to hide information.
• For example, in the English language, the letter "E" is the most used
letter. So, if you replace some "E"s with other letters, you can hide data.
• Example: Letter Frequency and a Hidden Word
Let's hide the word "CAT" using letter frequency.
Normal Text: In normal English text, "e" is very common, and "c," "a,"
and "t" have their normal frequencies.
Hiding "C": To hide the "C," we might slightly increase the frequency of
the letter "c" in a sentence. For example, "Cats can climb curtains."

Changing Statistical Properties of the Text:


• This is a more complex version of the previous method. Computers can
analyze the statistical patterns of a text and then create an algorithm
that hides data within the text by altering those patterns in a very small
way.
• The changes are so small that they are very hard to detect, even for
computers
Coding Implementation
Simple Coding Implementation (Python Example)
The Idea:
We'll use extra spaces at the end of each line to represent our secret message.
One space will mean "0," and two spaces will mean "1."

Python Code:
def encode_message(cover_text, secret_message):
"""Hides a secret message in extra spaces at the end of lines."""
binary_message = ''.join(format(ord(char), '08b') for char in secret_message)
#Converts message to binary
encoded_text = ""
binary_index = 0

for line in cover_text.splitlines():


encoded_text += line
if binary_index < len(binary_message):
if binary_message[binary_index] == '1':
encoded_text += " " # Two spaces for "1"
else:
encoded_text += " " # One space for "0"
binary_index += 1
encoded_text += "\n" #makes each line go to a new line.

return encoded_text
def decode_message(encoded_text):
"""Extracts the secret message from extra spaces."""
binary_message = ""
for line in encoded_text.splitlines():
if line.endswith(" "):
binary_message += "1"
elif line.endswith(" "):
binary_message += "0"

decoded_message = ""
for i in range(0, len(binary_message), 8):
byte = binary_message[i:i+8]
if len(byte) == 8:
decoded_message += chr(int(byte, 2))
return decoded_message

# Example Usage:
cover_text = """This is a normal text.
It has nothing special.
Just a plain document.
"""

secret_message = "Hi!"

encoded_result = encode_message(cover_text, secret_message)


print("Encoded Text:")
print(encoded_result)

decoded_result = decode_message(encoded_result)
print("\nDecoded Message:")
print(decoded_result)

Explanation:
1. encode_message(cover_text, secret_message):
o This function takes the regular text (cover_text) and the secret
message you want to hide.
o binary_message = ''.join(format(ord(char), '08b') for char in
secret_message): This line converts the secret message into binary
(0s and 1s).
o It goes through each line of the cover text.
o If there are still binary digits to hide, it adds one or two spaces to
the end of the line, depending on whether the binary digit is "0"
or "1."
o It returns the modified cover text with the hidden message.
2. decode_message(encoded_text):
o This function takes the encoded text (the text with the hidden
message).
o It goes through each line and checks if it ends with one or two
spaces.
o It builds a binary string based on the number of spaces.
o Then, it converts the binary string back into the original secret
message.
o It returns the extracted secret message.
3. Example Usage:
o We create a sample cover_text and a secret_message.
o We call encode_message to hide the secret message in the cover
text.
o We print the encoded text.
o We call decode_message to get the secret message back.
o We print the decoded message.

How it Works:
• The secret message is turned into a series of 0s and 1s.
• The extra spaces at the end of each line act like a secret code,
representing those 0s and 1s.
• The decoding function reads those extra spaces and turns them back
into the original message.

OUTPUT:

Encoded Text Output:


This is a normal text.
It has nothing special.
Just a plain document.
Decoded Message Output:
Hi!
Disadvantages of Text Steganography

Easy Detection (with simple methods):


• If you use fundamental ways to hide messages, like just adding extra
spaces, someone who's looking closely can find them pretty easily. It's
like hiding a cookie under a thin napkin – not very secure!
Limited Message Size:
• You can usually only hide small messages in text. It's like trying to fit a lot
of toys into a tiny box – there's just not enough room.
Changes Can Look Suspicious:
• If you change the text too much, it might look weird or unnatural. For
example, if you change too many words or add too many extra spaces,
people might start to wonder why the text looks so strange.
Vulnerable to Stegoanalysis:
• Just like there are people who hide messages, there are also people who
try to find them! Stegoanalysis is like detective work for hidden
messages. If someone knows how to use stegoanalysis tools, they might
be able to find your secret message.
Dependence on Cover Text:
• If the cover text is altered or destroyed, the hidden message is lost.
Ethical Concerns:
• Like any tool, steganography can be misused, such as hiding illegal or
harmful information. Therefore, it's important to use it responsibly.
Legal Issues:
• Depending on where you live and what you are hiding, using
steganography could be illegal. It is important to know the laws in your
area before using steganography.
Concept of Stegoanalysis
Imagine someone hides a secret note inside a picture. They might change tiny
bits of the picture, like making some colours a little brighter or darker, to store
the secret message. To our eyes, the picture looks normal, but a computer can
see those tiny changes.
Stegoanalysis is like being a super-smart detective who can find those hidden
changes. We use special tools to look at the picture (or any other file) very
carefully. These tools can find patterns and changes that are too small for us to
see.
Here's how it works:
1. Looking for Weird Stuff: First, we check if the file looks normal. If it has
strange patterns or changes, that's a clue!
2. Using Computer Tools: We use computer programs to analyze the file.
These programs can find hidden patterns, like changes in color, sound, or
even extra spaces in a text document.
3. Figuring Out the Code: If we find weird stuff, we try to figure out how
the message was hidden. It's like cracking a secret code!
4. Getting the Message: Once we crack the code, we can read the hidden
message.
Stegoanalysis is important because it helps us find hidden messages that might
be used for bad things, like sharing secret plans or illegal stuff. It's like being a
digital superhero, keeping the internet safe!
Real-world Applications
Watermarking (Hiding Copyright Information):
• Imagine you write a story and want to make sure everyone knows it's
yours. You could hide a secret "signature" inside the text using
steganography.
• This is like a secret code that proves you're the owner. If someone tries
to steal your story, you can show them the hidden signature and prove
it's yours.
• It is like hiding your name in invisible ink on your homework, so that if
someone copies it, you can prove that it is yours.
Secure Communication (in Certain Situations):
• Sometimes, people need to share information secretly. For example, a
journalist might need to talk to a source without anyone else knowing.
• They could hide messages inside normal-looking text files, so no one
suspects anything.
• It is like passing notes in class, but on a larger scale.
Protecting Digital Documents:
• Companies might hide secret information inside their documents, like
contracts or financial reports. This helps prevent people from changing
or stealing the information.
Hiding Messages in Video Games:
• Game developers might hide secret messages or Easter eggs inside their
games using steganography. This could be anything from hidden clues to
secret levels.
• This is a fun way to add extra things to a game and keep the players
entertained.
Ethics of Using Steganography
Good vs. Bad:
• Like any tool, steganography can be used for good or bad. It's like a
pencil – you can use it to write a nice story, or you can use it to write
something mean.
• It's important to use steganography responsibly and ethically.
Privacy vs. Security:
• Steganography can help protect people's privacy, but it can also be used
to hide illegal or harmful information.
• It's important to find a balance between privacy and security.
Being Responsible:
• It's important to think about the consequences of using steganography.
• Always use it for good purposes, like protecting your work or
communicating safely.
• It is like thinking about what you write in those notes you pass in class.
Make sure that it is nothing mean or harmful.
Conclusion
This study provides an extensive review of recent text steganography methods.
It also provides a classification of steganography based on each method. The
methods of text steganography are divided into three categories: format-based,
random and statistical generation, and linguistics methods. Moreover,
comparisons between these techniques are highlighted. This study shows that
increasing the capacity factor in the format-based method and increasing
security in linguistic steganography remain popular topics in text
steganography. However, robustness in this field has been paid less attention
by researchers. This study traced the development in the field of text
steganography and showed the employment of new technologies in this area.
By compiling the existing methods, these technologies were linked with the
existing steganography categories to help researchers. Consequently, this paper
indicates new research areas in text steganography by providing aspects that
can be considered for future directions.

References
https://www.geeksforgeeks.org/what-is-steganography/
https://www.researchgate.net/figure/Three-basic-categories-of-text-
steganography-Format-based-methods-used-physical-text_fig5_290009959
https://www.researchgate.net/publication/356056598_A_Review_on_Text_Ste
ganography_Techniques
https://www.irjmets.com/
https://iarjset.com/papers/social-and-ethical-implications-of-steganography-a-
case-study-
approach/#:~:text=The%20main%20ethical%20issue%20is,by%20trying%20to
%20communicate%20undetected.

You might also like