Hi ๐๐
Today i will share with you How to hide text into image using Python.
First, we need to know the science behind this idea called steganography.
Steganography is the art and science of writing hidden messages in such a way that no one, apart from the sender and intended recipient, suspects the existence of the message, a form of security through obscurity. Consequently, functions provided by Stegano only hide messages, without encryption. Steganography is often used with cryptography.
Second, after we know what steganography is,
we need module or liblary
To hide text into image you need to install module called stegano.
install from here : pip install stegano
If you want to hide text you need a PNG image if your image extintion is JPG or any thing else.
you need to convert it using this code :
from PIL import Image
img = Image.open('test.jpg')
img.save('test.png')
Now you have a PNG image you can hide your message ๐
from stegano.lsb import lsb
secret = lsb.hide('test.png', 'this is message to test ๐')
secret.save('out.png')
To extract the hidden message from out.png image you need to use function called reveal
from stegano.lsb import lsb
text = lsb.reveal('out.png')
print(text)
Result
this is message to test รป
Now we're done ๐ค
Don't forget to like and follow ๐
Support me on PayPal ๐ค
https://www.paypal.com/paypalme/amr396