Added some details about algorithm used.

This commit is contained in:
cedricbonhomme 2010-10-02 11:00:54 +02:00
parent 95e21b099e
commit 1c593b70c7
2 changed files with 11 additions and 7 deletions

2
LSB.py
View file

@ -61,7 +61,7 @@ def hide(img, message):
def reveal(img): def reveal(img):
""" """
Find a message in an encoded image (with the Find a message in an image (with the
LSB technic). LSB technic).
""" """
width, height = img.size width, height = img.size

View file

@ -8,9 +8,11 @@ from PIL import Image
def hide(img, message): def hide(img, message):
""" """
use the red portion of an image (r, g, b) tuple to Hide a message (string) in an image.
hide the message string characters as ASCII values
the red value of the first pixel is used for length of string Use the red portion of a pixel (r, g, b) tuple to
hide the message string characters as ASCII values.
The red value of the first pixel is used for length of string.
""" """
length = len(message) length = len(message)
# limit length of message to 255 # limit length of message to 255
@ -37,9 +39,11 @@ def hide(img, message):
def reveal(img): def reveal(img):
""" """
check the red portion of an image (r, g, b) tuple for Find a message in an image.
hidden message characters (ASCII values)
the red value of the first pixel is used for length of string Check the red portion of an pixel (r, g, b) tuple for
hidden message characters (ASCII values).
The red value of the first pixel is used for length of string.
""" """
width, height = img.size width, height = img.size
message = "" message = ""