mirror of
https://github.com/cedricbonhomme/Stegano.git
synced 2025-06-28 03:06:14 +02:00
The message is encoded in base 64.
This commit is contained in:
parent
fc03000cb1
commit
203060ac81
1 changed files with 5 additions and 3 deletions
|
@ -32,13 +32,14 @@ def hide(img, img_enc, copyright="http://bitbucket.org/cedricbonhomme/stegano"):
|
||||||
"""
|
"""
|
||||||
import shutil
|
import shutil
|
||||||
import datetime
|
import datetime
|
||||||
|
from base64 import b64encode
|
||||||
from exif.minimal_exif_writer import MinimalExifWriter
|
from exif.minimal_exif_writer import MinimalExifWriter
|
||||||
|
|
||||||
file = open("lorem_ipsum.txt", "r")
|
file = open("lorem_ipsum.txt", "r")
|
||||||
text = "\nImage annotation date: "
|
text = "\nImage annotation date: "
|
||||||
text = text + str(datetime.date.today())
|
text = text + str(datetime.date.today())
|
||||||
text = text + "\nImage description:\n"
|
text = text + "\nImage description:\n"
|
||||||
text = text + file.read()
|
text = b64encode(text + file.read())
|
||||||
file.close()
|
file.close()
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
@ -57,14 +58,15 @@ def hide(img, img_enc, copyright="http://bitbucket.org/cedricbonhomme/stegano"):
|
||||||
def reveal(img):
|
def reveal(img):
|
||||||
"""
|
"""
|
||||||
"""
|
"""
|
||||||
|
from base64 import b64decode
|
||||||
from exif.minimal_exif_reader import MinimalExifReader
|
from exif.minimal_exif_reader import MinimalExifReader
|
||||||
try:
|
try:
|
||||||
g = MinimalExifReader(img)
|
g = MinimalExifReader(img)
|
||||||
except:
|
except:
|
||||||
print("Impossible to read description.")
|
print("Impossible to read description.")
|
||||||
return
|
return
|
||||||
print(g.imageDescription())
|
print(b64decode(g.imageDescription()))
|
||||||
print(("Copyright " + g.copyright()))
|
print(("\nCopyright " + g.copyright()))
|
||||||
#print g.dateTimeOriginal()s
|
#print g.dateTimeOriginal()s
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue