Updated documentation.

This commit is contained in:
Cédric Bonhomme 2017-05-16 08:27:53 +02:00
parent 8f73d9e733
commit e0a172f868
No known key found for this signature in database
GPG key ID: A1CB94DE57B7A70D
3 changed files with 94 additions and 35 deletions

View file

@ -50,7 +50,7 @@ copyright = u'2012-2017, Cédric Bonhomme'
# The short X.Y version. # The short X.Y version.
version = '0.8' version = '0.8'
# The full version, including alpha/beta/rc tags. # The full version, including alpha/beta/rc tags.
release = '0.8' release = '0.8.1'
# The language for content autogenerated by Sphinx. Refer to documentation # The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages. # for a list of supported languages.

View file

@ -1,6 +1,9 @@
Using Stéganô as a Python module Using Stéganô as a Python module
================================ ================================
You can find more examples in the
`unit tests directory <https://github.com/cedricbonhomme/Stegano/tree/master/tests>`_.
LSB method LSB method
---------- ----------

View file

@ -1,5 +1,10 @@
Using Stéganô in command line for your scripts Using Stéganô in command line
============================================== =============================
The command ``stegano-lsb``
^^^^^^^^^^^^^^^^^^^^^^^^^^^
Hide and reveal a message with the LSB method.
Display help Display help
------------ ------------
@ -21,13 +26,17 @@ Display help
.. code-block:: bash .. code-block:: bash
$ stegano-lsb hide --help $ stegano-lsb hide --help
usage: stegano-lsb hide [-h] -i INPUT_IMAGE_FILE (-m SECRET_MESSAGE | -f SECRET_FILE) usage: stegano-lsb hide [-h] -i INPUT_IMAGE_FILE [-e {UTF-8,UTF-32LE}]
-o OUTPUT_IMAGE_FILE (-m SECRET_MESSAGE | -f SECRET_FILE) -o
OUTPUT_IMAGE_FILE
optional arguments: optional arguments:
-h, --help show this help message and exit -h, --help show this help message and exit
-i INPUT_IMAGE_FILE, --input INPUT_IMAGE_FILE -i INPUT_IMAGE_FILE, --input INPUT_IMAGE_FILE
Input image file. Input image file.
-e {UTF-8,UTF-32LE}, --encoding {UTF-8,UTF-32LE}
Specify the encoding of the message to hide. UTF-8
(default) or UTF-32LE.
-m SECRET_MESSAGE Your secret message to hide (non binary). -m SECRET_MESSAGE Your secret message to hide (non binary).
-f SECRET_FILE Your secret to hide (Text or any binary file). -f SECRET_FILE Your secret to hide (Text or any binary file).
-o OUTPUT_IMAGE_FILE, --output OUTPUT_IMAGE_FILE -o OUTPUT_IMAGE_FILE, --output OUTPUT_IMAGE_FILE
@ -37,18 +46,22 @@ Display help
.. code-block:: bash .. code-block:: bash
$ stegano-lsb reveal --help $ stegano-lsb reveal --help
usage: stegano-lsb reveal [-h] -i INPUT_IMAGE_FILE [-o SECRET_BINARY] usage: stegano-lsb reveal [-h] -i INPUT_IMAGE_FILE [-e {UTF-8,UTF-32LE}]
[-o SECRET_BINARY]
optional arguments: optional arguments:
-h, --help show this help message and exit -h, --help show this help message and exit
-i INPUT_IMAGE_FILE, --input INPUT_IMAGE_FILE -i INPUT_IMAGE_FILE, --input INPUT_IMAGE_FILE
Input image file. Input image file.
-e {UTF-8,UTF-32LE}, --encoding {UTF-8,UTF-32LE}
Specify the encoding of the message to reveal. UTF-8
(default) or UTF-32LE.
-o SECRET_BINARY Output for the binary secret (Text or any binary -o SECRET_BINARY Output for the binary secret (Text or any binary
file) file).
Hide and reveal a text message with the LSB method Hide and reveal a text message
-------------------------------------------------- ------------------------------
.. code-block:: bash .. code-block:: bash
@ -56,6 +69,17 @@ Hide and reveal a text message with the LSB method
$ stegano-lsb reveal -i ./Lenna_enc.png $ stegano-lsb reveal -i ./Lenna_enc.png
Hello World! Hello World!
Specify an encoding
-------------------
.. code-block:: bash
$ stegano-lsb hide -i ./tests/sample-files/Lenna.png -m 'I love 🍕 and 🍫.' -e UTF-32LE -o ./Lenna_enc.png
$ stegano-lsb reveal -i ./Lenna_enc.png
I love 🍕 and 🍫.
The default encoding is UTF-8.
Hide and reveal a binary file Hide and reveal a binary file
----------------------------- -----------------------------
@ -66,11 +90,19 @@ Hide and reveal a binary file
$ rm free-software-song.ogg $ rm free-software-song.ogg
$ stegano-lsb reveal -i ./Montenach_enc.png -o ./song.ogg $ stegano-lsb reveal -i ./Montenach_enc.png -o ./song.ogg
Hide and reveal a text message with the LSB method and generated sets
---------------------------------------------------------------------
The command ``stegano-lsb-set``
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Sets are used in order to select the pixels where the message will be hidden. Sets are used in order to select the pixels where the message will be hidden.
Hide and reveal a text message
------------------------------
.. code-block:: bash .. code-block:: bash
# Hide the message with the Sieve of Eratosthenes # Hide the message with the Sieve of Eratosthenes
@ -88,17 +120,47 @@ Sets are used in order to select the pixels where the message will be hidden.
# Try to reveal with Sieve of Eratosthenes # Try to reveal with Sieve of Eratosthenes
$ stegano-lsb-set reveal --generator eratosthenes -i ./surprise.png $ stegano-lsb-set reveal --generator eratosthenes -i ./surprise.png
# List all available generators An other example:
.. code-block:: bash
# Hide the message - LSB with a set defined by the identity function (f(x) = x).
stegano-lsb-set hide -i ./tests/sample-files/Montenach.png --generator identity -m 'I like steganography.' -o ./enc-identity.png
# Hide the message - LSB only.
stegano-lsb hide -i ./tests/sample-files/Montenach.png -m 'I like steganography.' -o ./enc.png
# Check if the two generated files are the same.
sha1sum ./enc-identity.png ./enc.png
# The output of lsb is given to lsb-set.
stegano-lsb-set reveal -i ./enc.png --generator identity
# The output of lsb-set is given to lsb.
stegano-lsb reveal -i ./enc-identity.png
List all available generators
------------------------------
.. code-block:: bash
$ stegano-lsb-set list-generators $ stegano-lsb-set list-generators
Generator id: Generator id:
ackermann ackermann
Desciption: Desciption:
Ackermann number. Ackermann number.
Generator id:
ackermann_naive
Desciption:
Ackermann number.
Generator id: Generator id:
carmichael carmichael
Desciption: Desciption:
Composite numbers n such that a^(n-1) == 1 (mod n) for every a coprime to n. Composite numbers n such that a^(n-1) == 1 (mod n) for every a coprime
to n.
https://oeis.org/A002997 https://oeis.org/A002997
Generator id: Generator id:
@ -138,7 +200,7 @@ Sets are used in order to select the pixels where the message will be hidden.
Generator id: Generator id:
mersenne mersenne
Desciption: Desciption:
Generate 2^n - 1. Generate 2^p - 1, where p is prime.
https://oeis.org/A001348 https://oeis.org/A001348
Generator id: Generator id:
@ -148,28 +210,18 @@ Sets are used in order to select the pixels where the message will be hidden.
http://oeis.org/A000217 http://oeis.org/A000217
An other example:
.. code-block:: bash
# Hide the message - LSB with a set defined by the identity function (f(x) = x).
stegano-lsb-set hide -i ./tests/sample-files/Montenach.png --generator identity -m 'I like steganography.' -o ./enc-identity.png
# Hide the message - LSB only.
stegano-lsb hide -i ./tests/sample-files/Montenach.png -m 'I like steganography.' -o ./enc.png
# Check if the two generated files are the same.
sha1sum ./enc-identity.png ./enc.png
# The output of lsb is given to lsb-set.
stegano-lsb-set reveal -i ./enc.png --generator identity
# The output of lsb-set is given to lsb.
stegano-lsb reveal -i ./enc-identity.png
Hide and reveal a text message with the red portion of a pixel
--------------------------------------------------------------
The command ``stegano-red``
^^^^^^^^^^^^^^^^^^^^^^^^^^^
Hide and reveal a text message with the red portion of a pixel.
Display help
------------
.. code-block:: bash .. code-block:: bash
@ -185,7 +237,11 @@ Hide and reveal a text message with the red portion of a pixel
-o OUTPUT_IMAGE_FILE, --output OUTPUT_IMAGE_FILE -o OUTPUT_IMAGE_FILE, --output OUTPUT_IMAGE_FILE
Image file Image file
$ stegano-red hide -i ./tests/sample-files/Lenna.png -m 'Basic steganography technique.' -o ~/Lenna1.png Hide and reveal a text message
------------------------------
.. code-block:: bash
$ stegano-red hide -i ./tests/sample-files/Lenna.png -m 'Basic steganography technique.' -o ~/Lenna1.png
$ stegano-red reveal -i ~/Lenna1.png $ stegano-red reveal -i ~/Lenna1.png
Basic steganography technique. Basic steganography technique.