mirror of
https://github.com/cedricbonhomme/Stegano.git
synced 2025-05-12 17:18:30 +02:00
Updated documentation.
This commit is contained in:
parent
f7d354a9c4
commit
1def5672ab
5 changed files with 151 additions and 79 deletions
|
@ -3,9 +3,6 @@
|
||||||
You can adapt this file completely to your liking, but it should at least
|
You can adapt this file completely to your liking, but it should at least
|
||||||
contain the root `toctree` directive.
|
contain the root `toctree` directive.
|
||||||
|
|
||||||
Welcome to Stéganô's documentation!
|
|
||||||
===================================
|
|
||||||
|
|
||||||
Presentation
|
Presentation
|
||||||
============
|
============
|
||||||
|
|
||||||
|
@ -33,7 +30,7 @@ Moreover some methods of steganalysis_ are provided:
|
||||||
Requirements
|
Requirements
|
||||||
============
|
============
|
||||||
|
|
||||||
- Python_ >= 3.2 (tested with Python 3.5.1);
|
- Python_ 3 (tested with Python 3.5.1);
|
||||||
- `Pillow`_;
|
- `Pillow`_;
|
||||||
- `piexif`_.
|
- `piexif`_.
|
||||||
|
|
||||||
|
@ -44,7 +41,10 @@ Turorial
|
||||||
.. toctree::
|
.. toctree::
|
||||||
:maxdepth: 2
|
:maxdepth: 2
|
||||||
|
|
||||||
tutorial
|
installation
|
||||||
|
module
|
||||||
|
software
|
||||||
|
steganalysis
|
||||||
|
|
||||||
You can also have a look at the
|
You can also have a look at the
|
||||||
`unit tests <https://github.com/cedricbonhomme/Stegano/tree/master/tests>`_.
|
`unit tests <https://github.com/cedricbonhomme/Stegano/tree/master/tests>`_.
|
||||||
|
|
18
docs/installation.rst
Normal file
18
docs/installation.rst
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
Installation
|
||||||
|
============
|
||||||
|
|
||||||
|
.. code-block:: bash
|
||||||
|
|
||||||
|
$ sudo pip install Stegano
|
||||||
|
|
||||||
|
You will be able to use Stéganô in your Python programs
|
||||||
|
or as a command line tool.
|
||||||
|
|
||||||
|
If you want to retrieve the source code (with the unit tests):
|
||||||
|
|
||||||
|
.. code-block:: bash
|
||||||
|
|
||||||
|
$ git clone https://github.com/cedricbonhomme/Stegano.git
|
||||||
|
|
||||||
|
.. image:: https://api.travis-ci.org/cedricbonhomme/Stegano.svg?branch=master
|
||||||
|
:target: https://travis-ci.org/cedricbonhomme/Stegano
|
109
docs/module.rst
Normal file
109
docs/module.rst
Normal file
|
@ -0,0 +1,109 @@
|
||||||
|
Using Stéganô as a Python module
|
||||||
|
================================
|
||||||
|
|
||||||
|
LSB method
|
||||||
|
----------
|
||||||
|
|
||||||
|
.. code-block:: python
|
||||||
|
|
||||||
|
Python 3.5.1 (default, Dec 7 2015, 11:33:57)
|
||||||
|
[GCC 4.9.2] on linux
|
||||||
|
Type "help", "copyright", "credits" or "license" for more information.
|
||||||
|
>>> from stegano import lsb
|
||||||
|
>>> secret = lsb.hide("./tests/sample-files/Lenna.png", "Hello world!")
|
||||||
|
>>> secret.save("./Lenna-secret.png")
|
||||||
|
>>> print(lsb.reveal("./Lenna-secret.png"))
|
||||||
|
Hello world!
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
LSB method with sets
|
||||||
|
--------------------
|
||||||
|
|
||||||
|
Sets are used in order to select the pixels where the message will be hidden.
|
||||||
|
|
||||||
|
.. code-block:: python
|
||||||
|
|
||||||
|
Python 3.5.1 (default, Dec 7 2015, 11:33:57)
|
||||||
|
[GCC 4.9.2] on linux
|
||||||
|
Type "help", "copyright", "credits" or "license" for more information.
|
||||||
|
>>> from stegano import lsbset
|
||||||
|
>>> from stegano.lsbset import generators
|
||||||
|
|
||||||
|
# Hide a secret with the Sieve of Eratosthenes
|
||||||
|
>>> secret_message = "Hello World!"
|
||||||
|
>>> secret_image = lsbset.hide("./tests/sample-files/Lenna.png",
|
||||||
|
secret_message,
|
||||||
|
generators.eratosthenes())
|
||||||
|
>>> secret_image.save("./image.png")
|
||||||
|
|
||||||
|
# Try to decode with another generator
|
||||||
|
>>> message = lsbset.reveal("./image.png", generators.fibonacci())
|
||||||
|
Traceback (most recent call last):
|
||||||
|
File "<stdin>", line 1, in <module>
|
||||||
|
File "/home/cedric/projects/Stegano/stegano/lsbset/lsbset.py", line 111, in reveal
|
||||||
|
for color in img_list[generated_number]:
|
||||||
|
IndexError: list index out of range
|
||||||
|
|
||||||
|
# Decode with Eratosthenes
|
||||||
|
>>> message = lsbset.reveal("./image.png", generators.eratosthenes())
|
||||||
|
>>> message
|
||||||
|
'Hello World!'
|
||||||
|
|
||||||
|
>>> # Generators available
|
||||||
|
>>> import inspect
|
||||||
|
>>> all_generators = inspect.getmembers(generators, inspect.isfunction)
|
||||||
|
>>> for generator in all_generators:
|
||||||
|
... print(generator[0], generator[1].__doc__)
|
||||||
|
...
|
||||||
|
Dead_Man_Walking None
|
||||||
|
OEIS_A000217
|
||||||
|
http://oeis.org/A000217
|
||||||
|
Triangular numbers: a(n) = C(n+1,2) = n(n+1)/2 = 0+1+2+...+n.
|
||||||
|
|
||||||
|
ackermann
|
||||||
|
Ackermann number.
|
||||||
|
|
||||||
|
carmichael None
|
||||||
|
eratosthenes
|
||||||
|
Generate the prime numbers with the sieve of Eratosthenes.
|
||||||
|
|
||||||
|
eratosthenes_composite
|
||||||
|
Generate the composite numbers with the sieve of Eratosthenes.
|
||||||
|
|
||||||
|
fermat
|
||||||
|
Generate the n-th Fermat Number.
|
||||||
|
|
||||||
|
fibonacci
|
||||||
|
A generator for Fibonacci numbers, goes to next number in series on each call.
|
||||||
|
This generator start at 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 610, 987, 1597, 2584, 4181, 6765, 10946, ...
|
||||||
|
See: http://oeis.org/A000045
|
||||||
|
|
||||||
|
identity
|
||||||
|
f(x) = x
|
||||||
|
|
||||||
|
log_gen
|
||||||
|
Logarithmic generator.
|
||||||
|
|
||||||
|
mersenne
|
||||||
|
Generate 2^n-1.
|
||||||
|
|
||||||
|
syracuse
|
||||||
|
Generate the sequence of Syracuse.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Description field of the image
|
||||||
|
------------------------------
|
||||||
|
|
||||||
|
For JPEG and TIFF images.
|
||||||
|
|
||||||
|
.. code-block:: python
|
||||||
|
|
||||||
|
Python 3.5.1 (default, Dec 7 2015, 11:33:57)
|
||||||
|
[GCC 4.9.2] on linux
|
||||||
|
Type "help", "copyright", "credits" or "license" for more information.
|
||||||
|
>>> from stegano import exifHeader
|
||||||
|
>>> secret = exifHeader.hide("./tests/sample-files/20160505T130442.jpg",
|
||||||
|
"./image.jpg", secret_message="Hello world!")
|
||||||
|
>>> print(exifHeader.reveal("./image.jpg"))
|
|
@ -1,57 +1,3 @@
|
||||||
Installation
|
|
||||||
============
|
|
||||||
|
|
||||||
.. code-block:: bash
|
|
||||||
|
|
||||||
$ sudo pip install Stegano
|
|
||||||
|
|
||||||
You will be able to use Stéganô in your Python programs
|
|
||||||
or as a command line tool.
|
|
||||||
|
|
||||||
If you want to retrieve the source code (with the unit tests):
|
|
||||||
|
|
||||||
.. code-block:: bash
|
|
||||||
|
|
||||||
$ git clone https://github.com/cedricbonhomme/Stegano.git
|
|
||||||
|
|
||||||
.. image:: https://api.travis-ci.org/cedricbonhomme/Stegano.svg?branch=master
|
|
||||||
:target: https://travis-ci.org/cedricbonhomme/Stegano
|
|
||||||
|
|
||||||
Using Stéganô as a Python module
|
|
||||||
================================
|
|
||||||
|
|
||||||
LSB method
|
|
||||||
----------
|
|
||||||
|
|
||||||
.. code-block:: python
|
|
||||||
|
|
||||||
Python 3.5.1 (default, Dec 7 2015, 11:33:57)
|
|
||||||
[GCC 4.9.2] on linux
|
|
||||||
Type "help", "copyright", "credits" or "license" for more information.
|
|
||||||
>>> from stegano import slsb
|
|
||||||
>>> secret = slsb.hide("./tests/sample-files/Lenna.png", "Hello world!")
|
|
||||||
>>> secret.save("./Lenna-secret.png")
|
|
||||||
>>> print(slsb.reveal("./Lenna-secret.png"))
|
|
||||||
Hello world!
|
|
||||||
|
|
||||||
Description field of the image
|
|
||||||
------------------------------
|
|
||||||
|
|
||||||
For JPEG and TIFF images.
|
|
||||||
|
|
||||||
.. code-block:: python
|
|
||||||
|
|
||||||
Python 3.5.1 (default, Dec 7 2015, 11:33:57)
|
|
||||||
[GCC 4.9.2] on linux
|
|
||||||
Type "help", "copyright", "credits" or "license" for more information.
|
|
||||||
>>> from stegano import exifHeader
|
|
||||||
>>> secret = exifHeader.hide("./tests/sample-files/20160505T130442.jpg",
|
|
||||||
"./image.jpg", secret_message="Hello world!")
|
|
||||||
>>> print(exifHeader.reveal("./image.jpg"))
|
|
||||||
|
|
||||||
More examples are available in the
|
|
||||||
`tests <https://github.com/cedricbonhomme/Stegano/tree/master/tests>`_.
|
|
||||||
|
|
||||||
Using Stéganô in command line for your scripts
|
Using Stéganô in command line for your scripts
|
||||||
==============================================
|
==============================================
|
||||||
|
|
||||||
|
@ -144,23 +90,3 @@ An other example:
|
||||||
|
|
||||||
# The output of lsb-set is given to lsb.
|
# The output of lsb-set is given to lsb.
|
||||||
lsb --reveal -i ./enc-identity.png
|
lsb --reveal -i ./enc-identity.png
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Steganalysis
|
|
||||||
============
|
|
||||||
|
|
||||||
.. code-block:: bash
|
|
||||||
|
|
||||||
# Hide the message with Sieve of Eratosthenes
|
|
||||||
lsb-set --hide -i ./tests/sample-files/Ginnifer-Goodwin.png -o ./surprise.png --generator eratosthenes -m 'Very important message.'
|
|
||||||
|
|
||||||
# Steganalysis of the original photo
|
|
||||||
steganalysis-parity -i ./tests/sample-files/Ginnifer-Goodwin.png -o ./surprise_st_original.png
|
|
||||||
|
|
||||||
# Steganalysis of the secret photo
|
|
||||||
steganalysis-parity -i ./surprise.png -o ./surprise_st_secret.png
|
|
||||||
|
|
||||||
# Reveal with Sieve of Eratosthenes
|
|
||||||
lsb-set --reveal --generator eratosthenes -i ./surprise.png
|
|
19
docs/steganalysis.rst
Normal file
19
docs/steganalysis.rst
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
Steganalysis
|
||||||
|
============
|
||||||
|
|
||||||
|
Parity
|
||||||
|
------
|
||||||
|
|
||||||
|
.. code-block:: bash
|
||||||
|
|
||||||
|
# Hide the message with Sieve of Eratosthenes
|
||||||
|
lsb-set --hide -i ./tests/sample-files/Ginnifer-Goodwin.png -o ./surprise.png --generator eratosthenes -m 'Very important message.'
|
||||||
|
|
||||||
|
# Steganalysis of the original photo
|
||||||
|
steganalysis-parity -i ./tests/sample-files/Ginnifer-Goodwin.png -o ./surprise_st_original.png
|
||||||
|
|
||||||
|
# Steganalysis of the secret photo
|
||||||
|
steganalysis-parity -i ./surprise.png -o ./surprise_st_secret.png
|
||||||
|
|
||||||
|
# Reveal with Sieve of Eratosthenes
|
||||||
|
lsb-set --reveal --generator eratosthenes -i ./surprise.png
|
Loading…
Add table
Reference in a new issue