Skip to content

Jish123K/imagesteganography

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 

Repository files navigation

imagesteganography

This code defines a class called "Steganography" which has methods to encrypt and decrypt data using AES encryption, compress and decompress data using gzip, merge two images by hiding a message in the first image using least significant bit (LSB) steganography, and unmerge an image to reveal the hidden message.

The code also defines a function called "generate_key" which generates a random encryption key using Fernet.

The "main" function defines an argument parser using the "argparse" library, which allows the user to either merge two images and hide a message in the first image, or unmerge an image and reveal the hidden message.

If the "merge" command is chosen, the program prompts the user to enter the message they want to hide, encrypts the message using AES encryption and the randomly generated encryption key, and then hides the encrypted message in the first image using LSB steganography. The second image is then merged with the steganographic image and the resulting merged image is saved to the output path specified by the user.

If the "extract" command is chosen, the program loads the input image specified by the user, extracts the steganographic data using LSB steganography, decrypts the steganographic data using the encryption key generated by the "generate_key" function, and writes the decrypted data to the output path specified by the user.

Overall, this code provides a simple implementation of steganography using image manipulation and encryption techniques.