diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 1cd70d6..05a3170 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -1,6 +1,13 @@ Release History =============== +0.6.4 (2017-02-06) +------------------ + +* a command line for the 'red' module has been added; +* bugfix: fixed a bug in the lsb-set command line when the generator wasn't + specified by the user. + 0.6.3 (2017-01-29) ------------------ diff --git a/bin/lsb-set b/bin/lsb-set index bf1a7a0..83fc6dc 100755 --- a/bin/lsb-set +++ b/bin/lsb-set @@ -72,6 +72,12 @@ parser_reveal.add_argument("-o", dest="secret_binary", arguments = parser.parse_args() +try: + arguments.generator_function +except AttributeError: + print('You must specify the name of a generator.') + parser.print_help() + exit(1) try: generator = getattr(generators, arguments.generator_function)() diff --git a/bin/stegano-red b/bin/stegano-red new file mode 100644 index 0000000..ef36caf --- /dev/null +++ b/bin/stegano-red @@ -0,0 +1,56 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Stéganô - Stéganô is a basic Python Steganography module. +# Copyright (C) 2010-2017 Cédric Bonhomme - https://www.cedricbonhomme.org +# +# For more information : https://github.com/cedricbonhomme/Stegano +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see + +__author__ = "Cedric Bonhomme" +__version__ = "$Revision: 0.1 $" +__date__ = "$Date: 2017/02/06 $" +__license__ = "GPLv3" + +try: + from stegano import red +except: + print("Install stegano: sudo pip install Stegano") + +import argparse +parser = argparse.ArgumentParser(prog='stegano-red') +subparsers = parser.add_subparsers(help='sub-command help', dest='command') + +parser_hide = subparsers.add_parser('hide', help='hide help') +parser_hide.add_argument("-i", "--input", dest="input_image_file", + help="Image file") +parser_hide.add_argument("-m", dest="secret_message", + help="Your secret message to hide (non binary).") +parser_hide.add_argument("-o", "--output", dest="output_image_file", + help="Image file") + +parser_reveal = subparsers.add_parser('reveal', help='reveal help') +parser_reveal.add_argument("-i", "--input", dest="input_image_file", + help="Image file") + +arguments = parser.parse_args() + +if arguments.command == 'hide': + secret = red.hide(arguments.input_image_file, arguments.secret_message) + secret.save(arguments.output_image_file) + +elif arguments.command == 'reveal': + secret = red.reveal(arguments.input_image_file) + print(secret) diff --git a/docs/software.rst b/docs/software.rst index 16165e5..4f12aa1 100644 --- a/docs/software.rst +++ b/docs/software.rst @@ -107,3 +107,26 @@ An other example: # The output of lsb-set is given to lsb. lsb reveal -i ./enc-identity.png + + +Hide and reveal a text message with the red portion of a pixel +-------------------------------------------------------------- + +.. code-block:: bash + + $ stegano-red hide --help + usage: stegano-red hide [-h] [-i INPUT_IMAGE_FILE] [-m SECRET_MESSAGE] + [-o OUTPUT_IMAGE_FILE] + + optional arguments: + -h, --help show this help message and exit + -i INPUT_IMAGE_FILE, --input INPUT_IMAGE_FILE + Image file + -m SECRET_MESSAGE Your secret message to hide (non binary). + -o OUTPUT_IMAGE_FILE, --output OUTPUT_IMAGE_FILE + Image file + + $ stegano-red hide -i ./tests/sample-files/Lenna.png -m 'Basic steganography technique.' -o ~/Lenna1.png + + $ stegano-red reveal -i ~/Lenna1.png + Basic steganography technique. diff --git a/setup.py b/setup.py index 7f80d85..8614255 100644 --- a/setup.py +++ b/setup.py @@ -22,6 +22,7 @@ packages = [ scripts = [ 'bin/lsb', 'bin/lsb-set', + 'bin/stegano-red', 'bin/steganalysis-parity', 'bin/steganalysis-statistics' ] @@ -35,7 +36,7 @@ with open('CHANGELOG.rst', 'r') as f: setup( name='Stegano', - version='0.6.3', + version='0.6.4', author='Cédric Bonhomme', author_email='cedric@cedricbonhomme.org', packages=packages, @@ -53,7 +54,6 @@ setup( "Environment :: Console", "Topic :: Utilities", "Operating System :: OS Independent", - "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)"