Giter VIP home page Giter VIP logo

steganographerpy's Introduction

steganographer

image

image

Code Health

Documentation Status

Hide messages and files inside an image.

https://pypi.python.org/pypi/steganographer

Description

Given an image and a message or a file, steganographer will hide the message or file in the bits of the image. Works best when PNGs are passed in. Will convert JPGs to PNGs because of compression. Only tested with png and jpg.

Compatiable with python 3 and up.

Install:

pip install steganographer

Usage:

Hide a message in an image.

  • steganographer inputImage.png -m "Message to hide."
  • steganographer inputImage.png -m "Message to hide." -o outputImage.png

Reveal a hidden message.

  • steganographer inputImage.png
  • steganographer inputImage.png -o revealedMessage.txt

Hide a file in an image.

  • steganographer inputImage.png -f fileToHide.zip
  • steganographer inputImage.png -f fileToHide.zip -o fileHiddenImage.png

Reveal a file in an image.

  • steganographer inputImage.png -r
  • steganographer inputImage.png -r -o revealedFile.zip

Development Notes:

After cloning have pip-tools installed and run this command to get the correct requirements.

  • pip-sync dev-requirements.txt requirements.txt test-requirements.txt

Adding project site

steganographerpy's People

Contributors

motadan avatar

Stargazers

 avatar

Watchers

 avatar  avatar

steganographerpy's Issues

Update steganographer tests

Update the steganographer tests so they test hide and reveal data instead of just the string related functions.

Make command line usable

Currently everything is run by tests. Need to make it so it can be used from the command line with arguments.

Write hide function

The hide function needs to be written. Should take in a buffer and string. Returns the buffer with the string hidden in its least significant bits.

Fix image paths with dots

If an image is passed in that has '.' as part of its path the PIL library will crash. This is because PIL can not automatically determine the extension.

Add ability to hide a file in an image

Use open data file function to get all the bytes and hide them in an image. Give an option -i instead of a message. Give an option -of to get the file back out.

Fix jpegs failing

When hiding a message in a jpeg the image is visibly corrupted and the message cannot be retrieved correctly.

Get pytest to show the coverage again

When typing in pytest it no longer gives me the coverage of the tests. I believe this was in a config file that I deleted when trying to release. A workaround would be putting this in manually
py.test --doctest-modules --cov . --cov-report term-missing
But it throws errors related to setup.py.

Fix crashes when installing from pip

When installed on not my computer trying to run after installing from pip caused and error. The -h option did not work and there was a stack trace.

Refactor hideString

hideString is currently identical to hideData. If there is no useful difference between hideString and hideData, hideString should be removed and its tests updated or removed. If there is someway it can do something unique from hideData it should do it while calling hideData.

Refactor revealString

revealString only returns astring that it has the full bytes for. It needs to be rewritten to do this through use of revealData. Could also be renamed something like revealDataFull to represent its only returning full bytes. Tests would need to be updated on a name change. Should definitely be changed it hideString is removed.

Use header when hiding data

Use a header with the number of bytes hidden. Currently when revealing data there is no way to know when the data has all been read. When strings are hidden they are passed in with a null terminator hiding this issue. The first thing hidden should be the number of bytes that are hidden.

100% tests

  • Fix test coverage on Linux by ignoring the main functions related to unicode errors.
  • Fix smells code from landcape.

Fix bmps failing

When trying to use a bmp as the image there is an error and it does not finish.

Travis didn't deploy wheel

When travis ci deployed to PyPI it didn't not upload a wheel file. The distribution section of the .travis file needs to be quoted. It currently just looks at sdist and stops.

Fix loss of data

When the data passed in is not long enough to contain the string it causes a loss of data. test_steganographerShortPartialData is an example of this. It is short 4 bytes and there is no way to get those bytes back. A revealData function in addition to the revealString function may be needed. This may also be a problem when hiding.

Get Unicode working

Unicode values that are hidden do not get properly revealed. By default python uses utf-8 which is a variable length Unicode. Should probably change over to something fixed like utf-16 and change the byte length to 16 or adjust it in some way. Adding ๐“ˆ to a message is enough to fail it.

Fix tests

The tests need to have the correct inputs and return values for the hide and reveal functions.
Hide should return a buffer with 'A' hidden in the least significant bits.
Reveal should return the letter A when given the buffer from hide.

Write reveal function

The reveal function should take in a buffer and strip out the least significant bits at each position and combine them into the correct string.

Have steganographerHide return file name of output

Have steganographerHide return the name of the file that contains the message. Update and check any related tests as well. Use the returned name in the output message, ie "The message was hidden in inputSteganogrified.png"

Check use of bytearray vs bytes

bytearray is used everywhere in the code, it is mutable. Check uses and convert ones where the bytearray is never changed over to bytes, which are immutable.

Fix corruption of png files

When hiding data in a png file the output is corrupt and will not open. Need to figure out the format of png files and not overwrite their header information.

Fix running from command line

After installing with pip, I can not run steganographer from the command line. I am given this error.

C:\Users\Daniel>steganographer
Traceback (most recent call last):
File "c:\users\daniel\appdata\local\programs\python\python35-32\lib\runpy.py", line 184, in run_module_as_main
"main", mod_spec)
File "c:\users\daniel\appdata\local\programs\python\python35-32\lib\runpy.py", line 85, in run_code
exec(code, run_globals)
File "C:\Users\Daniel\AppData\Local\Programs\Python\Python35-32\Scripts\steganographer.exe__main
.py", line 5, in
ImportError: cannot import name 'main'

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.