mirror of
https://github.com/cedricbonhomme/Stegano.git
synced 2025-05-13 09:28:31 +02:00
it is now possible to specify the encoding (UTF-8 or UTF-32LE) of the message to hide/reveal through the command line (for the LSb module).
This commit is contained in:
parent
b907985886
commit
61b6ec7175
3 changed files with 15 additions and 3 deletions
|
@ -1,6 +1,11 @@
|
||||||
Release History
|
Release History
|
||||||
===============
|
===============
|
||||||
|
|
||||||
|
0.8.1 (not yet released)
|
||||||
|
------------------------
|
||||||
|
* it is now possible to specify the encoding (UTF-8 or UTF-32LE) of the message
|
||||||
|
to hide/reveal through the command line.
|
||||||
|
|
||||||
0.8 (2017-05-06)
|
0.8 (2017-05-06)
|
||||||
----------------
|
----------------
|
||||||
* updated command line. All commands are now prefixed with *stegano-*;
|
* updated command line. All commands are now prefixed with *stegano-*;
|
||||||
|
|
|
@ -40,6 +40,9 @@ parser_hide = subparsers.add_parser('hide', help='hide help')
|
||||||
# Original image
|
# Original image
|
||||||
parser_hide.add_argument("-i", "--input", dest="input_image_file",
|
parser_hide.add_argument("-i", "--input", dest="input_image_file",
|
||||||
required=True, help="Input image file.")
|
required=True, help="Input image file.")
|
||||||
|
parser_hide.add_argument("-e", "--encoding", dest="encoding", default="UTF-8",
|
||||||
|
help="Specify the encoding of the message to hide." +
|
||||||
|
" UTF-8 (default) or UTF-32LE.")
|
||||||
|
|
||||||
group_secret = parser_hide.add_mutually_exclusive_group(required=True)
|
group_secret = parser_hide.add_mutually_exclusive_group(required=True)
|
||||||
# Non binary secret message to hide
|
# Non binary secret message to hide
|
||||||
|
@ -58,6 +61,9 @@ parser_hide.add_argument("-o", "--output", dest="output_image_file",
|
||||||
parser_reveal = subparsers.add_parser('reveal', help='reveal help')
|
parser_reveal = subparsers.add_parser('reveal', help='reveal help')
|
||||||
parser_reveal.add_argument("-i", "--input", dest="input_image_file",
|
parser_reveal.add_argument("-i", "--input", dest="input_image_file",
|
||||||
required=True, help="Input image file.")
|
required=True, help="Input image file.")
|
||||||
|
parser_reveal.add_argument("-e", "--encoding", dest="encoding", default="UTF-8",
|
||||||
|
help="Specify the encoding of the message to reveal." +
|
||||||
|
" UTF-8 (default) or UTF-32LE.")
|
||||||
parser_reveal.add_argument("-o", dest="secret_binary",
|
parser_reveal.add_argument("-o", dest="secret_binary",
|
||||||
help="Output for the binary secret (Text or any binary file).")
|
help="Output for the binary secret (Text or any binary file).")
|
||||||
|
|
||||||
|
@ -71,7 +77,8 @@ if arguments.command == 'hide':
|
||||||
elif arguments.secret_file != None:
|
elif arguments.secret_file != None:
|
||||||
secret = tools.binary2base64(arguments.secret_file)
|
secret = tools.binary2base64(arguments.secret_file)
|
||||||
|
|
||||||
img_encoded = lsb.hide(arguments.input_image_file, secret)
|
img_encoded = lsb.hide(arguments.input_image_file, secret,
|
||||||
|
arguments.encoding)
|
||||||
try:
|
try:
|
||||||
img_encoded.save(arguments.output_image_file)
|
img_encoded.save(arguments.output_image_file)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
|
@ -79,7 +86,7 @@ if arguments.command == 'hide':
|
||||||
print(e)
|
print(e)
|
||||||
|
|
||||||
elif arguments.command == 'reveal':
|
elif arguments.command == 'reveal':
|
||||||
secret = lsb.reveal(arguments.input_image_file)
|
secret = lsb.reveal(arguments.input_image_file, arguments.encoding)
|
||||||
if arguments.secret_binary != None:
|
if arguments.secret_binary != None:
|
||||||
data = tools.base642binary(secret)
|
data = tools.base642binary(secret)
|
||||||
with open(arguments.secret_binary, "wb") as f:
|
with open(arguments.secret_binary, "wb") as f:
|
||||||
|
|
2
setup.py
2
setup.py
|
@ -29,7 +29,7 @@ with open('CHANGELOG.rst', 'r') as f:
|
||||||
|
|
||||||
setup(
|
setup(
|
||||||
name='Stegano',
|
name='Stegano',
|
||||||
version='0.8',
|
version='0.8.1',
|
||||||
author='Cédric Bonhomme',
|
author='Cédric Bonhomme',
|
||||||
author_email='cedric@cedricbonhomme.org',
|
author_email='cedric@cedricbonhomme.org',
|
||||||
packages=packages,
|
packages=packages,
|
||||||
|
|
Loading…
Add table
Reference in a new issue