{"id":26740,"date":"2022-03-31T02:21:22","date_gmt":"2022-03-30T20:51:22","guid":{"rendered":"https:\/\/python-programs.com\/?p=26740"},"modified":"2022-03-31T02:21:22","modified_gmt":"2022-03-30T20:51:22","slug":"image-based-steganography-using-python","status":"publish","type":"post","link":"https:\/\/python-programs.com\/image-based-steganography-using-python\/","title":{"rendered":"Image Based Steganography using Python"},"content":{"rendered":"

What is Steganography?<\/strong><\/p>\n

Steganography is the process of hiding a secret message within a larger one in such a way that the presence or contents of the hidden message are unknown. The goal of steganography is to keep communication between two parties hidden. Unlike cryptography, which allows us to hide the content of a secret message, Steganography hides the fact that a message has been sent. Despite the fact that Steganography and Cryptography are not the same, there are some parallels between the two. Steganography is classified as a type of cryptography by some writers since hidden communication appears to be a secret message.<\/p>\n

Steganography is the process of hiding confidential data within an ordinary file during transmission. Secret data and ordinary files can both take the form of a text message, image, audio clip, or video file.
\nImage steganography is the practice of hiding sensitive data within an image or video file.<\/p>\n

A simple example of hiding a text message within an image is provided below. The two main steps are as follows:<\/p>\n

Encryption<\/strong> is the process of storing a text message within an image.<\/p>\n

Decryption<\/strong> is the process of extracting the message hidden within an image.<\/p>\n

Before going to the coding part we should first install the pillow and stepic libraries into our system<\/p>\n

Installation:<\/strong><\/p>\n

\n
pip\u00a0install\u00a0Pillow<\/pre>\n
\n
\n
pip\u00a0install\u00a0stepic<\/pre>\n<\/div>\n<\/div>\n<\/div>\n

Output:<\/strong><\/p>\n

Collecting stepic\r\nDownloading stepic-0.5.0.tar.gz (219 kB)\r\n|\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588| 219 kB 4.1 MB\/s \r\nRequirement already satisfied: pillow in \/usr\/local\/lib\/python3.7\/\r\ndist-packages\r\n (from stepic) (7.1.2)\r\nBuilding wheels for collected packages: stepic\r\nBuilding wheel for stepic (setup.py) ... done\r\nCreated wheel for stepic: filename=stepic-0.5.0-py3-none-any.whl size=12428\r\n sha256=bcf777c1de2853e6fd38c63e0ba14b7d95c6803aebac77f72f18752979b216a2\r\nStored in directory: \/root\/.cache\/pip\/wheels\/47\/8d\/57\/322e721ace59cf72d3282\r\n42bbc636e6affc672344cf5480f33\r\nSuccessfully built stepic\r\nInstalling collected packages: stepic\r\nSuccessfully installed stepic-0.5.0<\/pre>\n

pillow module in Python:<\/strong><\/p>\n

Pillow is a Python Imaging Library (PIL) that allows you to open, manipulate, and save images in a variety of formats.<\/p>\n

stepic module in Python:<\/strong>
\nstepic is a Python package for hiding data within an image by slightly altering the image’s colors. These changes are normally unnoticeable to the naked eye, but they are detectable by machines.<\/p>\n

Image-Based Steganography using Python<\/h2>\n

1)Encryption<\/strong><\/p>\n

Approach:<\/strong><\/p>\n