mirror of
https://github.com/cedricbonhomme/Stegano.git
synced 2025-05-12 17:18:30 +02:00
Minor bugfix.
This commit is contained in:
parent
12497ce88d
commit
2f34fac27c
2 changed files with 5 additions and 5 deletions
6
lsb-s.py
6
lsb-s.py
|
@ -137,7 +137,7 @@ if __name__ == '__main__':
|
||||||
|
|
||||||
# Non binary secret message to hide
|
# Non binary secret message to hide
|
||||||
parser.add_option("-m", "--secret-message", dest="secret_message",
|
parser.add_option("-m", "--secret-message", dest="secret_message",
|
||||||
help="Your secret message to hide(non binary).")
|
help="Your secret message to hide (non binary).")
|
||||||
|
|
||||||
# Binary secret to hide (OGG, executable, etc.)
|
# Binary secret to hide (OGG, executable, etc.)
|
||||||
parser.add_option("-f", "--secret-file", dest="secret_file",
|
parser.add_option("-f", "--secret-file", dest="secret_file",
|
||||||
|
@ -156,7 +156,7 @@ if __name__ == '__main__':
|
||||||
if sys.argv[1] == "hide":
|
if sys.argv[1] == "hide":
|
||||||
if options.secret_message != "" and options.secret_file == "":
|
if options.secret_message != "" and options.secret_file == "":
|
||||||
secret = options.secret_message
|
secret = options.secret_message
|
||||||
elif options.secret_message == "" and options.secret_file =! "":
|
elif options.secret_message == "" and options.secret_file != "":
|
||||||
secret = tools.binary2base64(options.secret_file)
|
secret = tools.binary2base64(options.secret_file)
|
||||||
|
|
||||||
img = Image.open(options.input_image_file)
|
img = Image.open(options.input_image_file)
|
||||||
|
@ -175,4 +175,4 @@ if __name__ == '__main__':
|
||||||
with open(options.secret_binary, "w") as f:
|
with open(options.secret_binary, "w") as f:
|
||||||
f.write(data)
|
f.write(data)
|
||||||
else:
|
else:
|
||||||
print secret
|
print secret
|
||||||
|
|
4
tools.py
4
tools.py
|
@ -89,7 +89,7 @@ def binary2base64(binary_file, output_file):
|
||||||
fin.close()
|
fin.close()
|
||||||
|
|
||||||
# Encode binary to base64 string (printable)
|
# Encode binary to base64 string (printable)
|
||||||
return b64_data = base64.b64encode(binary_data)
|
return base64.b64encode(binary_data)
|
||||||
|
|
||||||
"""fout = open(output_file, "w")
|
"""fout = open(output_file, "w")
|
||||||
fout.write(b64_data)
|
fout.write(b64_data)
|
||||||
|
@ -104,4 +104,4 @@ def base642binary(b64_fname):
|
||||||
b64_str = fin.read()
|
b64_str = fin.read()
|
||||||
fin.close()
|
fin.close()
|
||||||
# Decode base64 string to original binary sound object
|
# Decode base64 string to original binary sound object
|
||||||
return base64.b64decode(b64_str)
|
return base64.b64decode(b64_str)
|
||||||
|
|
Loading…
Add table
Reference in a new issue