Skip to main content

Simple Python package for steganography

Project description


This is a simple Python package for steganography

Now this package can automatically detect the encoding of the hidden text using the '-a' argument. Code to hide information in the given image:

import lsb
from PIL import Image
import numpy as np
img=Image.open('test.png')
img=np.array(img)
info=b'Some information'
hidden=lsb.lsbenc(img,info)
img_hidden=Image.fromarray(hidden)
img_hidden.save('hidden.png')# Must be a PNG,BMP,etc., not JPEG or WEBP

Code to get the hidden information from the given image:

import lsb
from PIL import Image
import numpy as np
img=Image.open('test.png')# Must be a PNG,BMP,etc., not JPEG or WEBP
img=np.array(img)
info=lsb.lsbdec(img)
print(info)

RSA

RSA is now supported in easylsb 1.0.7. Code:

import lsb
from PIL import Image
import numpy as np
import rsa
pub,priv=rsa.newkeys(200)
img=Image.open('test.png')
img=np.array(img)
info=b'Some information'
# Hide
hidden=lsb.lsbenc(img,info,rsakey=pub)
img_hidden=Image.fromarray(hidden)
img_hidden.save('hidden.png')# Must be a PNG,BMP,etc., not JPEG or WEBP
# Recover
info=lsb.lsbdec(hidden,rsakey=priv)
print(info)# b'Some information'

It's very easy to use the StegSolve tool to get the hidden information, but easylsb package allows you to encrypt the information using DES or RSA.

WARNING: Python 2 is unsupported by easylsb since easylsb 1.0.7, if you're using Python 2 and want to install this package, you should use the command "pip install easylsb==1.0.6"

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

easylsb-1.0.9.tar.gz (5.0 kB view hashes)

Uploaded Source

Built Distribution

easylsb-1.0.9-py3-none-any.whl (5.5 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page