mirror of
https://github.com/cedricbonhomme/Stegano.git
synced 2025-05-13 01:18:31 +02:00
Fixed some bugs.
This commit is contained in:
parent
cda0578448
commit
28ba1e54cf
6 changed files with 23 additions and 35 deletions
8
bin/slsb
8
bin/slsb
|
@ -27,7 +27,7 @@ __license__ = "GPLv3"
|
||||||
try:
|
try:
|
||||||
from stegano import slsb
|
from stegano import slsb
|
||||||
except:
|
except:
|
||||||
print "Install stegano: python setup.py install"
|
print("Install Stegano: sudo pip install Stegano")
|
||||||
|
|
||||||
from stegano import tools
|
from stegano import tools
|
||||||
|
|
||||||
|
@ -71,9 +71,9 @@ if options.hide:
|
||||||
img_encoded = slsb.hide(options.input_image_file, secret)
|
img_encoded = slsb.hide(options.input_image_file, secret)
|
||||||
try:
|
try:
|
||||||
img_encoded.save(options.output_image_file)
|
img_encoded.save(options.output_image_file)
|
||||||
except Exception, e:
|
except Exception as e:
|
||||||
# If hide() returns an error (Too long message).
|
# If hide() returns an error (Too long message).
|
||||||
print e
|
print(e)
|
||||||
|
|
||||||
elif options.reveal:
|
elif options.reveal:
|
||||||
secret = slsb.reveal(options.input_image_file)
|
secret = slsb.reveal(options.input_image_file)
|
||||||
|
@ -82,4 +82,4 @@ elif options.reveal:
|
||||||
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)
|
||||||
|
|
10
bin/slsb-set
10
bin/slsb-set
|
@ -27,7 +27,7 @@ __license__ = "GPLv3"
|
||||||
try:
|
try:
|
||||||
from stegano import slsbset
|
from stegano import slsbset
|
||||||
except:
|
except:
|
||||||
print "Install stegano: python setup.py install"
|
print("Install stegano: sudo pip install Stegano")
|
||||||
|
|
||||||
from stegano import tools
|
from stegano import tools
|
||||||
|
|
||||||
|
@ -77,19 +77,19 @@ if options.hide:
|
||||||
img_encoded = slsbset.hide(options.input_image_file, secret, options.generator_function)
|
img_encoded = slsbset.hide(options.input_image_file, secret, options.generator_function)
|
||||||
try:
|
try:
|
||||||
img_encoded.save(options.output_image_file)
|
img_encoded.save(options.output_image_file)
|
||||||
except Exception, e:
|
except Exception as e:
|
||||||
# If hide() returns an error (Too long message).
|
# If hide() returns an error (Too long message).
|
||||||
print e
|
print(e)
|
||||||
|
|
||||||
elif options.reveal:
|
elif options.reveal:
|
||||||
try:
|
try:
|
||||||
secret = slsbset.reveal(options.input_image_file, options.generator_function)
|
secret = slsbset.reveal(options.input_image_file, options.generator_function)
|
||||||
except IndexError:
|
except IndexError:
|
||||||
print "Impossible to detect message."
|
print("Impossible to detect message.")
|
||||||
exit(0)
|
exit(0)
|
||||||
if options.secret_binary != "":
|
if options.secret_binary != "":
|
||||||
data = tools.base642binary(secret)
|
data = tools.base642binary(secret)
|
||||||
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)
|
||||||
|
|
|
@ -27,7 +27,7 @@ __license__ = "GPLv3"
|
||||||
try:
|
try:
|
||||||
from stegano import steganalysisParity
|
from stegano import steganalysisParity
|
||||||
except:
|
except:
|
||||||
print "Install stegano: python setup.py install"
|
print("Install Stegano: sudo pip install Stegano")
|
||||||
|
|
||||||
from PIL import Image
|
from PIL import Image
|
||||||
|
|
||||||
|
|
18
setup.py
18
setup.py
|
@ -12,8 +12,7 @@ except ImportError:
|
||||||
|
|
||||||
packages = [
|
packages = [
|
||||||
'stegano',
|
'stegano',
|
||||||
'stegano.exif',
|
'stegano.exif'
|
||||||
'bin'
|
|
||||||
]
|
]
|
||||||
|
|
||||||
requires = ['pillow']
|
requires = ['pillow']
|
||||||
|
@ -23,12 +22,12 @@ with open('README.md', 'r') as f:
|
||||||
|
|
||||||
setup(
|
setup(
|
||||||
name='Stegano',
|
name='Stegano',
|
||||||
version='0.4.2',
|
version='0.4.3',
|
||||||
author='Cédric Bonhomme',
|
author='Cédric Bonhomme',
|
||||||
author_email='cedric@cedricbonhomme.org',
|
author_email='cedric@cedricbonhomme.org',
|
||||||
packages=packages,
|
packages=packages,
|
||||||
include_package_data=True,
|
include_package_data=True,
|
||||||
#scripts=[''],
|
scripts=['bin/slsb', 'bin/slsb-set', 'bin/steganalysis-parity'],
|
||||||
url='https://bitbucket.org/cedricbonhomme/stegano',
|
url='https://bitbucket.org/cedricbonhomme/stegano',
|
||||||
description='A Python Steganography module.',
|
description='A Python Steganography module.',
|
||||||
long_description=readme,
|
long_description=readme,
|
||||||
|
@ -46,14 +45,3 @@ setup(
|
||||||
"License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)"
|
"License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)"
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
|
|
||||||
if sys.argv[-1] == "install":
|
|
||||||
print("Installing binaries")
|
|
||||||
shutil.copy2("./bin/slsb-set", "/bin/slsb-set")
|
|
||||||
shutil.copymode("./bin/slsb-set", "/bin/slsb-set")
|
|
||||||
|
|
||||||
shutil.copy2("./bin/slsb", "/bin/slsb")
|
|
||||||
shutil.copymode("./bin/slsb", "/bin/slsb")
|
|
||||||
|
|
||||||
shutil.copy2("./bin/steganalysis-parity", "/bin/steganalysis-parity")
|
|
||||||
shutil.copymode("./bin/steganalysis-parity", "/bin/steganalysis-parity")
|
|
||||||
|
|
|
@ -28,7 +28,7 @@ import sys
|
||||||
|
|
||||||
from PIL import Image
|
from PIL import Image
|
||||||
|
|
||||||
import tools
|
from . import tools
|
||||||
|
|
||||||
def hide(input_image_file, message):
|
def hide(input_image_file, message):
|
||||||
"""
|
"""
|
||||||
|
|
|
@ -28,8 +28,8 @@ import sys
|
||||||
|
|
||||||
from PIL import Image
|
from PIL import Image
|
||||||
|
|
||||||
import tools
|
from . import tools
|
||||||
import generators
|
from . import generators
|
||||||
|
|
||||||
def hide(input_image_file, message, generator_function):
|
def hide(input_image_file, message, generator_function):
|
||||||
"""
|
"""
|
||||||
|
|
Loading…
Add table
Reference in a new issue