• Home
  • News
  • Software
  • Knowledge
  • MMO
  • Tips
  • Security
  • Network
  • Office
AnonyViet - English Version
  • Home
  • News
  • Software
  • Knowledge
  • MMO
  • Tips
  • Security
  • Network
  • Office
No Result
View All Result
  • Home
  • News
  • Software
  • Knowledge
  • MMO
  • Tips
  • Security
  • Network
  • Office
No Result
View All Result
AnonyViet - English Version
No Result
View All Result

How to create secret messages in photos with python

AnonyViet by AnonyViet
April 24, 2025
in Tips
0

Today, I will show you how to apply encrypted skills, by hiding secret codes or secret messages in the photo Python. Steganography is a technique used for quite a long time. Since World War II, it has been used as a way of communication between allies and preventing information that has been revealed by enemies. I will show you how to do this with two different techniques, one technique related to Secret Key and the other.

Join the channel Telegram belong to Anonyviet 👉 Link 👈

How to create secret messages in photos with python

Request

You install Python and then continue to install the two libraries below.

Setting

pip install steganocryptopy
pip install stegano

Note: If you use Linux, replace PIP to PIP3.

How to the secret message in the photo does not need the key

I will hide the text in the image without any encryption lock, so the recipient can decode and get hidden text very easy.

Advantage

The advantage of this is that it is very simple so you will not have to solve any troubles.

Disadvantages

Anyone can decode as long as they use the same library that you have used during the encryption process.

Syntax

from stegano import lsb
secret = lsb.hide(path_to_img, secret_msg)
secret.save(ecrypted_img_name)

You must have a sample image in your project folder to hide the notice, next we must provide the path to the prepared image.

For example

>>> from stegano import lsb
>>> secret = lsb.hide("sample.png", "Python is dangerous be careful")
>>> secret.save("sample_secret.png")

Note: Because the Sample.png file is in the same folder as the execution file .py, just write the image file name is enough. If the image file is different from the folder, you need to fully record the path.

Now if you look at the project folder, you will realize there is a new image with the name sample_secret.png. Looking at or looking closely, you don’t know where there are messages hidden in it, right?

Decode

Make sure the image has a hidden text in your project directory.

Syntax

>>> from stegano import lsb
>>>lsb.reveal(path_to_an_image)

For example

>>> from stegano import lsb
>>>lsb.reveal('sample_secret.png')
'Python is dangerous be careful'

Done, now we will go into the way of hiding text in the image with Secret Key.

How to hide text in images with Secret Key

I will hide the secret text along with an encryption lock to decipher it. Therefore, only the key can decode it.

Advantage

It is very safe because only those with the key can decipher it.

Disadvantages

When the encryption key is lost, the decoding process will be a bit complicated.

Syntax

>>>from steganocryptopy.steganography import Steganography
>>> Steganography.generate_key(path_to_key)
>>> encrypted = Steganography.encrypt(path_to_key, path_to_img, path_to_secretfile)
>>> encrypted.save(encrypted_imgname)

For example

Suppose I have a key file called keya file containing a hidden notice called Classified.us And the image is named Sample.png.

>>>from steganocryptopy.steganography import Steganography
>>> Steganography.generate_key("key")
>>> encrypted = Steganography.encrypt("key","sample.png",  "classified.us")
>>> encrypted.save("Secret.png")

Now when you run the above code, you will see a new image on your project folder Secret.png.

Decode

To decode the image, you will need a file key And your encrypted image.

Syntax

>>> from steganocryptopy.steganography import Steganography
>>> Steganography.decrypt(path_to_key, path_to_image)

For example

>>> from steganocryptopy.steganography import Steganography
>>> Steganography.decrypt("key", "Secret_img.png")
'Life is short you need Python\n'

Congratulations, you have just learned how to hide secret messages in the image, now don’t be afraid to share messages with your friends.

Previous Post

Anyviewer: remote computer control on Android super easy

Next Post

Instructions for using anyone to delete noise in the video

AnonyViet

AnonyViet

Related Posts

Instructions for cleaning LG TV with Antigravity to help it run faster
Tips

Instructions for cleaning LG TV with Antigravity to help it run faster

October 30, 2026
Quét lỗ hổng bảo mật cho Vide Coding bằng Security Audit Skill
Tips

Quét lỗ hổng bảo mật cho Vide Coding bằng Security Audit Skill

October 27, 2026
Instructions for registering for OxionAI Pro for 1 year with many powerful AI models
Tips

Instructions for registering for OxionAI Pro for 1 year with many powerful AI models

October 24, 2026
How are Windows 11 Pro and Windows 10 Pro different?
Tips

How are Windows 11 Pro and Windows 10 Pro different?

October 23, 2026
Instructions for using CleanYourTV: Remove ads on Android TV, Google TV
Tips

Instructions for using CleanYourTV: Remove ads on Android TV, Google TV

October 23, 2026
How to use Messenger without a Facebook account
Tips

How to use Messenger without a Facebook account

October 22, 2026
Next Post
Instructions for using anyone to delete noise in the video

Instructions for using anyone to delete noise in the video

0 0 votes
Article Rating
Subscribe
Login
Notify of
guest

guest

0 Comments
Oldest
Newest Most Voted

Recent News

Receive Driver Booster 14 license key immediately for free for 6 months

Receive Driver Booster 14 license key immediately for free for 6 months

November 1, 2026
Online pagoda game: Experience practice and relieve stress at home

Online pagoda game: Experience practice and relieve stress at home

November 1, 2026
Instructions for receiving Avira Prime 3 months for free, no credit card

Instructions for receiving Avira Prime 3 months for free, no credit card

October 31, 2026
Instructions for cleaning LG TV with Antigravity to help it run faster

Instructions for cleaning LG TV with Antigravity to help it run faster

October 30, 2026
Receive Driver Booster 14 license key immediately for free for 6 months

Receive Driver Booster 14 license key immediately for free for 6 months

November 1, 2026
Online pagoda game: Experience practice and relieve stress at home

Online pagoda game: Experience practice and relieve stress at home

November 1, 2026
Instructions for receiving Avira Prime 3 months for free, no credit card

Instructions for receiving Avira Prime 3 months for free, no credit card

October 31, 2026
AnonyViet - English Version

AnonyViet

AnonyViet is a website share knowledge that you have never learned in school!

We are ready to welcome your comments, as well as your articles sent to AnonyViet.

Follow Us

Contact:

Email: anonyviet.com[@]gmail.com

Main Website: https://anonyviet.com

Recent News

Receive Driver Booster 14 license key immediately for free for 6 months

Receive Driver Booster 14 license key immediately for free for 6 months

November 1, 2026
Online pagoda game: Experience practice and relieve stress at home

Online pagoda game: Experience practice and relieve stress at home

November 1, 2026
  • Home
  • Home 2
  • Home 3
  • Home 4
  • Home 5
  • Home 6
  • Next Dest Page
  • Sample Page

say88 tỷ lệ kèo nhà cái kèo nhà cái 5 febet

No Result
View All Result
  • Home
  • News
  • Software
  • Knowledge
  • MMO
  • Tips
  • Security
  • Network
  • Office

say88 tỷ lệ kèo nhà cái kèo nhà cái 5 febet

wpDiscuz
0
0
Would love your thoughts, please comment.x
()
x
| Reply