Coder Social home page Coder Social logo

lsbsteg's Introduction

lsbsteg

License: MIT

lsbsteg is a small Python 3 application which embeds text messages into images using the Least Significant Bit steganographic algorithm.

The basic idea of the algorithm is to take each individual bit of the message and set it as the least significant bit of each component of each pixel of the image. Usually, a pixel has Red, Green, Blue components and sometimes an Alpha component. Because the values of these components change very little if the least significant bit is changed, the color difference is not particularly noticeable, if at all.

Requirements

  • pillow
  • pycrypto (optional)

If you are on a Linux system, you most likely have the required dependencies already. If you don't, they can be easily installed using pip.

sudo pip3 install -U pillow
sudo pip3 install -U pycrypto

If you get 'decoder not available' errors when running the application make sure you have all the pillow dependencies installed:

sudo apt-get install libjpeg-dev zlib1g-dev
sudo pip3 install -I pillow

Usage

lsbsteg.py [-h] [-v] {embed,extract} ...

The application can both embed messages into images and extract them.

Embedding messages into images

lsbsteg.py embed [-h] [-o OUT] [-k KEY] IMAGE MESSAGE

positional arguments:
    IMAGE      source image
    MESSAGE    message to embed into the image

optional arguments:
    -o OUT, --output OUT    generated output image containing the specified message
    -k KEY, --key KEY       key used to encrypt the message before embedding it
  • Note: if the output image is not provided, the message is saved in the input image.

Without encryption

lsbsteg.py embed -o output.png input.png "message to embed"

With encryption

lsbsteg.py embed -o output.png -k passphraze input.png "message to embed"

Because JPEG uses lossy compression, it cannot be specified as an output image format. Instead, it can be converted to a lossless compression format like PNG even if the input image is a JPEG image.

lsbsteg.py embed -o output.png input.jpg "the message you want to embed"
  • Note: if pycrypto is not installed, the application does not have encryption support.

Extracting messages from images

lsbsteg.py extract [-h] [-k KEY] IMAGE

positional arguments:
    IMAGE    image containing message

optional arguments:
    -k KEY, --key KEY    key to decrypt the extracted message

Without encryption

lsbsteg.py extract output.png

With encryption

lsbsteg.py extract -k passphraze output.png

License

Copyright (c) 2015 Adrian-George Bostan.

This project is licensed under the MIT license. See LICENSE for more details.

lsbsteg's People

Contributors

adrg avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

lsbsteg's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.