mirror of
https://github.com/cedricbonhomme/Stegano.git
synced 2025-05-12 17:18:30 +02:00
chg: [core ] various minor fixes.
This commit is contained in:
parent
b64d039389
commit
4aac55ec77
4 changed files with 5 additions and 8 deletions
|
@ -22,9 +22,9 @@ classifiers = [
|
||||||
"Intended Audience :: Science/Research",
|
"Intended Audience :: Science/Research",
|
||||||
"Topic :: Security",
|
"Topic :: Security",
|
||||||
"Operating System :: OS Independent",
|
"Operating System :: OS Independent",
|
||||||
"Programming Language :: Python :: 3.7",
|
|
||||||
"Programming Language :: Python :: 3.8",
|
"Programming Language :: Python :: 3.8",
|
||||||
"Programming Language :: Python :: 3.9",
|
"Programming Language :: Python :: 3.9",
|
||||||
|
"Programming Language :: Python :: 3.10",
|
||||||
"License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)"
|
"License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)"
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
|
@ -37,13 +37,13 @@ def hide(
|
||||||
from zlib import compress
|
from zlib import compress
|
||||||
from base64 import b64encode
|
from base64 import b64encode
|
||||||
|
|
||||||
if secret_file != None:
|
if secret_file is not None:
|
||||||
with open(secret_file, "r") as f:
|
with open(secret_file, "r") as f:
|
||||||
secret_message = f.read()
|
secret_message = f.read()
|
||||||
|
|
||||||
try:
|
try:
|
||||||
text = compress(b64encode(bytes(secret_message, "utf-8")))
|
text = compress(b64encode(bytes(secret_message, "utf-8")))
|
||||||
except:
|
except Exception:
|
||||||
text = compress(b64encode(secret_message))
|
text = compress(b64encode(secret_message))
|
||||||
|
|
||||||
img = tools.open_image(input_image_file)
|
img = tools.open_image(input_image_file)
|
||||||
|
|
|
@ -128,7 +128,7 @@ def reveal(
|
||||||
if count == tools.ENCODINGS[encoding]:
|
if count == tools.ENCODINGS[encoding]:
|
||||||
bitab.append(chr(buff))
|
bitab.append(chr(buff))
|
||||||
buff, count = 0, 0
|
buff, count = 0, 0
|
||||||
if bitab[-1] == ":" and limit == None:
|
if bitab[-1] == ":" and limit is None:
|
||||||
if "".join(bitab[:-1]).isdigit():
|
if "".join(bitab[:-1]).isdigit():
|
||||||
limit = int("".join(bitab[:-1]))
|
limit = int("".join(bitab[:-1]))
|
||||||
else:
|
else:
|
||||||
|
|
|
@ -22,13 +22,11 @@
|
||||||
__author__ = "Cedric Bonhomme"
|
__author__ = "Cedric Bonhomme"
|
||||||
__version__ = "$Revision: 0.2 $"
|
__version__ = "$Revision: 0.2 $"
|
||||||
__date__ = "$Date: 2010/10/01 $"
|
__date__ = "$Date: 2010/10/01 $"
|
||||||
__revision__ = "$Date: 2016/08/26 $"
|
__revision__ = "$Date: 2021/11/01 $"
|
||||||
__license__ = "GPLv3"
|
__license__ = "GPLv3"
|
||||||
|
|
||||||
import typing
|
import typing
|
||||||
import operator
|
|
||||||
|
|
||||||
from PIL import Image
|
|
||||||
from collections import Counter
|
from collections import Counter
|
||||||
from collections import OrderedDict
|
from collections import OrderedDict
|
||||||
|
|
||||||
|
@ -37,7 +35,6 @@ def steganalyse(img):
|
||||||
"""
|
"""
|
||||||
Steganlysis of the LSB technique.
|
Steganlysis of the LSB technique.
|
||||||
"""
|
"""
|
||||||
encoded = img.copy()
|
|
||||||
width, height = img.size
|
width, height = img.size
|
||||||
colours_counter = Counter() # type: typing.Counter[int]
|
colours_counter = Counter() # type: typing.Counter[int]
|
||||||
for row in range(height):
|
for row in range(height):
|
||||||
|
|
Loading…
Add table
Reference in a new issue