Professional Documents
Culture Documents
Cyber Security
Cyber Security
Cyber Security
STEGANOGRAPHY
AGENDA
01 02 03
04 05
Function Demonstration /
Breakdown And Results
Modelling
Introduction to Steganography
Steganography is the practice of concealing a message, file, image, or video within another
message, file, image, or video in order to hide the existence of the concealed information.
The goal of steganography is to hide the fact that there is any hidden information. Unlike
cryptography, which focuses on making a message secret through encryption, steganography aims to
make the very existence of the message undetectable.
Steganography is often used for legitimate purposes, such as digital watermarking to protect
intellectual property or embedding metadata in files. However, it can also be misused for covert
communication or malicious activities. Security measures and tools are continuously developed to detect
and counteract steganographic techniques.
There are various techniques for implementing steganography, and they can be applied to different types of media. Some
common methods include:
1. Image Steganography: Concealing information within digital images by subtly modifying the pixel values. This can
involve hiding data in the least significant bits of the image, using specific patterns, or altering the color values.
2. Audio Steganography: Embedding data within audio files by manipulating certain aspects of the sound, such as modifying
the frequency or amplitude of the audio signal.
3. Text Steganography: Concealing information within text by using techniques like hiding messages in whitespace,
changing the font or style of specific characters, or even using invisible ink.
4. Video Steganography: Hiding data within video files by modifying certain frames or by subtly altering the video stream.
5. Network Steganography: Concealing data within network protocols or communication patterns.
PROJECT OVERVIEW (Python Code)
Hiding a text in an image
Objective:
The project aims to demonstrate a basic form of steganography, specifically hiding a text message within
the pixels of an image.
I used a method of Hiding a text message within the pixels of an image is a form of steganography.
Here's a step-by-step explanation of how text is typically hidden within the pixels of an image :
2. Image Pixels:
In a digital image, each pixel is composed of color channels, often represented as red (R), green (G), and blue (B).
Each color channel has a value ranging from 0 to 255 in an 8-bit image.
3. Least Significant Bit (LSB) Replacement:
The least significant bit (LSB) is the rightmost bit in a binary representation. In steganography, the LSB of the color
channels in the image can be modified without significantly altering the color or appearance to the human eye.
index = 0
for i in range(image.width):
for j in range(image.height):
r, g, b = image.getpixel((i, j))
if index < len(binary_secret_message):
image.putpixel((i, j), (r, g, int(format(b, '08b')[:-1] + binary_secret_message[index], 2)))
index += 1
image.save(output_image_path)
input_image_path = input("Enter the input image path to extract message from: ")
dpassword = input("Enter the password to decrypt the message: ")
decrypted_message = extract_text_from_image(input_image_path, dpassword)
if epassword==dpassword:
print("Decrypted message: ", secret_message)
else:
print("Password incorrect !!!!")
print("Thanks for exicuting")
if __name__ == "__main__":
main()
Function Breakdown
1. hide_text_in_image function :
• Takes the paths for the input image, output image, secret message, and a key (password).
• Opens the input image using the Python Imaging Library (PIL).
• Converts the secret message to binary and checks if it's too large for the image.
• Iterates through each pixel in the image, modifying the least significant bit of the blue channel to encode
the message.
• Saves the modified image to the output path.
2. extract_text_from_image function :
• Takes the input image path and a key (password).
• Opens the image using PIL.
• Iterates through each pixel in the image, extracting the least significant bit of the blue channel to
reconstruct the binary message.
• Converts the binary message back to text.
3. main function :
• Takes user input for input and output image paths, a secret message, and a password (encryption and
decryption password).
• Calls the hide_text_in_image function to hide the message in the image.
• Takes user input for the input image path from which to extract the message and the decryption
password.
• Calls the extract_text_from_image function and prints the decrypted message if the password
matches.
4.Script Execution :
• The script runs the main function when executed.
• Users are prompted to provide input image paths, secret messages, and passwords.
5.Password Check :
• The script checks if the encryption and decryption passwords match before printing the decrypted
message.
Steganography Algorithm Model
Input:
MODELLING
Original Image : An image file containing the carrier data
Secret Message : A text message to be hidden within the image
Password : An optional password for encrypting the secret message
Output:
Steganographed Image: An image file containing the hidden secret message.
Process:
Image Loading: Load the original image into the program.
Message Encoding: Convert the secret message into a binary string representation.
LSB Modification: Iterate over each pixel in the image and modify the least significant bit (LSB) of each pixel to store a bit of the
secret message.
Password Encryption (Optional): If a password is provided, apply a password-based encryption algorithm to the embedded secret
message.
Image Saving: Save the modified image as the steganographed image.
Steganography Algorithm Model
Assumptions:
The image has sufficient capacity to embed the secret message without significantly affecting the image quality.
The LSB modification technique is effective in hiding the secret message without compromising the image's visual
appearance.
The password-based encryption algorithm provides adequate security for the hidden message.
Limitations:
The embedded secret message is vulnerable to image manipulation techniques that may alter the LSBs of pixels.
The password-based encryption relies on the strength of the chosen password and is susceptible to brute-force attacks if the
password is weak.
This model provides a high-level abstraction of the steganography algorithm, capturing the essential aspects of the input,
process, output, assumptions, and limitations. It serves as a useful tool for understanding, communicating, and analyzing
the algorithm.
Results
dog.jpg encrypted.jpg
( Original image ) ( Encrypted Image )
WHO ARE THE END USERS of this project ?
1. General Users Interested in Privacy:
Individuals who want to secure their messages or data within images for personal privacy.
2. Security Professionals:
Security experts and professionals who may use steganography for secure communication or data hiding.
6. Cybersecurity Enthusiasts:
Individuals interested in cybersecurity and cryptography as a hobby or for educational purposes.
MY SOLUTION AND ITS VALUE PROPOSITION
1. Educational Purposes:
The script provides a simple and educational example of how steganography can be implemented using a widely understood
method (LSB).
2. User-Friendly Interaction:
The script is interactive, prompting users for input paths, messages, and passwords. This makes it accessible for users with
basic programming knowledge.
3. Practical Demonstration:
It demonstrates the practical application of steganography by allowing users to hide and extract messages within images.
5. Key Security:
The use of a password for both encryption and decryption adds a basic layer of security, ensuring that only those with the
correct password can extract the hidden message.
6. Awareness and Understanding:
It raises awareness about the existence of steganography and its potential applications. Users can gain insights into the concept
of hiding information within seemingly innocuous data.
8. Ethical Considerations:
By incorporating a password for encryption and decryption, the script encourages users to think about the ethical implications of
hiding and extracting information, emphasizing the importance of responsible use.
Potential Enhancements:
Integration of more robust steganography techniques.
Implementation of additional security measures.
Consideration of steganalysis and countermeasures.
Development of a graphical user interface (GUI) for improved user experience.
How did I customize the project and make it my own
I used basic Python implementation of image steganography using the LSB method.
Here are some ways i have personalized or customized the project :
1. User Interaction:
I added user prompts to input the paths, messages, and passwords, making the script interactive and user-friendly.
2. Encryption Password:
I implemented a password (encryption key) for hiding the message in the image and a corresponding decryption
password for extracting the message. This adds a layer of security and customization.
3. Error Handling:
I have added additional error-checking mechanisms or improved the script's robustness by handling potential issues
or edge cases.
4. Security Measures:
Depending on my use case, I have implemented additional security measures, such as encryption of the entire image
or using more advanced steganography techniques.
Thanks !
https://github.com/Veerendrakb15/cryptography
veerendrakbelmar_aiml@jnnce.ac.in
https://www.linkedin.com/in/veerendra-k-belmar-7b
6288262/