Skip to content

Commit

Permalink
Updated CHANGELOG.
Browse files Browse the repository at this point in the history
  • Loading branch information
cedricbonhomme committed May 23, 2023
1 parent e490e32 commit 0537c13
Show file tree
Hide file tree
Showing 20 changed files with 89 additions and 92 deletions.
23 changes: 16 additions & 7 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,26 +1,36 @@
ci:
autoupdate_schedule: monthly
repos:
- repo: https://github.com/adamchainz/django-upgrade
rev: 1.13.0
hooks:
- id: django-upgrade
args: [--target-version, '4.2']
- repo: https://github.com/asottile/pyupgrade
rev: v2.31.1
rev: v3.3.1
hooks:
- id: pyupgrade
args: ["--py37-plus"]
- repo: https://github.com/asottile/reorder_python_imports
rev: v3.0.1
- repo: https://github.com/PyCQA/isort
rev: 5.12.0
hooks:
- id: reorder-python-imports
additional_dependencies: ["setuptools>60.9"]
- id: isort
- repo: https://github.com/psf/black
rev: 22.3.0
hooks:
- id: black
- repo: https://github.com/asottile/blacken-docs
rev: 1.13.0
hooks:
- id: blacken-docs
- repo: https://github.com/PyCQA/flake8
rev: 4.0.1
hooks:
- id: flake8
additional_dependencies:
- flake8-bugbear
- flake8-implicit-str-concat
args: ["--max-line-length=100"]
args: ["--max-line-length=125"]
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.1.0
hooks:
Expand All @@ -31,4 +41,3 @@ repos:
rev: v2.5.6
hooks:
- id: pip-audit
args: ["--ignore-vuln", "PYSEC-2022-203"]
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
## Release History


### 0.11.2 (2023-05-23)

* improved typing of various functions;
* updated dependencies.


### 0.11.1 (2022-11-20)

* Fixed a bug in the command line when no sub-command is specified.
Expand Down
19 changes: 9 additions & 10 deletions bin/lsb.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-

# Stegano - Stegano is a pure Python steganography module.
# Copyright (C) 2010-2022 Cédric Bonhomme - https://www.cedricbonhomme.org
# Copyright (C) 2010-2023 Cédric Bonhomme - https://www.cedricbonhomme.org
#
# For more information : https://github.com/cedricbonhomme/Stegano
#
Expand All @@ -26,6 +24,7 @@
__license__ = "GPLv3"

import inspect

import crayons

try:
Expand All @@ -34,10 +33,10 @@
except Exception:
print("Install stegano: pipx install Stegano")

from stegano import tools

import argparse

from stegano import tools


class ValidateGenerator(argparse.Action):
def __call__(self, parser, args, values, option_string=None):
Expand Down Expand Up @@ -76,7 +75,7 @@ def main():
choices=tools.ENCODINGS.keys(),
default="UTF-8",
help="Specify the encoding of the message to hide."
+ " UTF-8 (default) or UTF-32LE.",
" UTF-8 (default) or UTF-32LE.",
)

# Generator
Expand Down Expand Up @@ -131,7 +130,7 @@ def main():
choices=tools.ENCODINGS.keys(),
default="UTF-8",
help="Specify the encoding of the message to reveal."
+ " UTF-8 (default) or UTF-32LE.",
" UTF-8 (default) or UTF-32LE.",
)

# Generator
Expand Down Expand Up @@ -179,7 +178,7 @@ def main():
generator = getattr(generators, arguments.generator_function[0])()

except AttributeError:
print("Unknown generator: {}".format(arguments.generator_function))
print(f"Unknown generator: {arguments.generator_function}")
exit(1)

if arguments.command == "hide":
Expand Down Expand Up @@ -223,6 +222,6 @@ def main():
all_generators = inspect.getmembers(generators, inspect.isfunction)
for generator in all_generators:
print("Generator id:")
print(" {}".format(crayons.green(generator[0], bold=True)))
print(f" {crayons.green(generator[0], bold=True)}")
print("Desciption:")
print(" {}".format(generator[1].__doc__))
print(f" {generator[1].__doc__}")
8 changes: 3 additions & 5 deletions bin/parity.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-

# Stegano - Stegano is a pure Python steganography module.
# Copyright (C) 2010-2022 Cédric Bonhomme - https://www.cedricbonhomme.org
# Copyright (C) 2010-2023 Cédric Bonhomme - https://www.cedricbonhomme.org
#
# For more information : https://github.com/cedricbonhomme/Stegano
#
Expand All @@ -24,10 +22,10 @@
__date__ = "$Date: 2016/08/25 $"
__license__ = "GPLv3"

from PIL import Image

import argparse

from PIL import Image

try:
from stegano.steganalysis import parity
except Exception:
Expand Down
4 changes: 1 addition & 3 deletions bin/red.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-

# Stegano - Stegano is a pure Python steganography module.
# Copyright (C) 2010-2022 Cédric Bonhomme - https://www.cedricbonhomme.org
# Copyright (C) 2010-2023 Cédric Bonhomme - https://www.cedricbonhomme.org
#
# For more information : https://github.com/cedricbonhomme/Stegano
#
Expand Down
8 changes: 3 additions & 5 deletions bin/statistics.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-

# Stegano - Stegano is a pure Python steganography module.
# Copyright (C) 2010-2022 Cédric Bonhomme - https://www.cedricbonhomme.org
# Copyright (C) 2010-2023 Cédric Bonhomme - https://www.cedricbonhomme.org
#
# For more information : https://github.com/cedricbonhomme/Stegano
#
Expand All @@ -25,10 +23,10 @@
__revision__ = "$Date: 2016/08/26 $"
__license__ = "GPLv3"

from PIL import Image

import argparse

from PIL import Image

try:
from stegano.steganalysis import statistics
except Exception:
Expand Down
9 changes: 2 additions & 7 deletions docs/conf.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
#
# Stéganô documentation build configuration file, created by
# sphinx-quickstart on Wed Jul 25 13:33:39 2012.
Expand All @@ -10,17 +9,13 @@
#
# All configuration values have a default; values that are commented out
# serve to show the default.

# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
# sys.path.insert(0, os.path.abspath('.'))

# -- General configuration -----------------------------------------------------

# If your documentation needs a minimal Sphinx version, state it here.
# needs_sphinx = '1.0'

# Add any Sphinx extension module names here, as strings. They can be extensions
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
extensions = []
Expand All @@ -39,7 +34,7 @@

# General information about the project.
project = "Stegano"
copyright = "2010-2022, Cédric Bonhomme"
copyright = "2010-2023, Cédric Bonhomme"
author = "Cédric Bonhomme <[email protected]>"

# The version info for the project you're documenting, acts as replacement for
Expand Down Expand Up @@ -170,6 +165,6 @@
latex_show_urls = True
latex_show_pagerefs = True

ADDITIONAL_PREAMBLE = """
ADDITIONAL_PREAMBLE = r"""
\setcounter{tocdepth}{3}
"""
5 changes: 4 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "stegano"
version = "0.11.1"
version = "0.11.2"
description = "A pure Python Steganography module."
authors = [
"Cédric Bonhomme <[email protected]>"
Expand Down Expand Up @@ -76,3 +76,6 @@ show_error_context = true
pretty = true

exclude = "build|dist|docs|stegano.egg-info"

[tool.isort]
profile = "black"
9 changes: 4 additions & 5 deletions stegano/exifHeader/exifHeader.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-

# Stegano - Stegano is a pure Python steganography module.
# Copyright (C) 2010-2022 Cédric Bonhomme - https://www.cedricbonhomme.org
# Copyright (C) 2010-2023 Cédric Bonhomme - https://www.cedricbonhomme.org
#
# For more information : https://git.sr.ht/~cedric/stegano
#
Expand All @@ -26,6 +24,7 @@
__license__ = "GPLv3"

import piexif

from stegano import tools


Expand All @@ -37,11 +36,11 @@ def hide(
img_format=None,
):
"""Hide a message (string) in an image."""
from zlib import compress
from base64 import b64encode
from zlib import compress

if secret_file is not None:
with open(secret_file, "r") as f:
with open(secret_file) as f:
secret_message = f.read()

try:
Expand Down
7 changes: 4 additions & 3 deletions stegano/lsb/generators.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env python
# Stegano - Stegano is a pure Python steganography module.
# Copyright (C) 2010-2022 Cédric Bonhomme - https://www.cedricbonhomme.org
# Copyright (C) 2010-2023 Cédric Bonhomme - https://www.cedricbonhomme.org
#
# For more information : https://git.sr.ht/~cedric/stegano
#
Expand All @@ -24,10 +24,11 @@
__license__ = "GPLv3"

import itertools
import math
from typing import Any, Dict, Iterator, List

import cv2
import numpy as np
import math
from typing import Dict, Iterator, List, Any


def identity() -> Iterator[int]:
Expand Down
7 changes: 3 additions & 4 deletions stegano/lsb/lsb.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-

# Stegano - Stegano is a pure Python steganography module.
# Copyright (C) 2010-2022 Cédric Bonhomme - https://www.cedricbonhomme.org
# Copyright (C) 2010-2023 Cédric Bonhomme - https://www.cedricbonhomme.org
#
# For more information : https://git.sr.ht/~cedric/stegano
#
Expand All @@ -27,9 +25,10 @@

from typing import IO, Iterator, Union

from .generators import identity
from stegano import tools

from .generators import identity


def hide(
image: Union[str, IO[bytes]],
Expand Down
4 changes: 1 addition & 3 deletions stegano/red/red.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-

# Stegano - Stéganô is a basic Python Steganography module.
# Copyright (C) 2010-2022 Cédric Bonhomme - https://www.cedricbonhomme.org
# Copyright (C) 2010-2023 Cédric Bonhomme - https://www.cedricbonhomme.org
#
# For more information : https://git.sr.ht/~cedric/stegano
#
Expand Down
4 changes: 1 addition & 3 deletions stegano/steganalysis/parity.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-

# Stegano - Stegano is a pure Python steganography module.
# Copyright (C) 2010-2022 Cédric Bonhomme - https://www.cedricbonhomme.org
# Copyright (C) 2010-2023 Cédric Bonhomme - https://www.cedricbonhomme.org
#
# For more information : https://git.sr.ht/~cedric/stegano
#
Expand Down
6 changes: 2 additions & 4 deletions stegano/steganalysis/statistics.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env python
# Stegano - Stegano is a pure Python steganography module.
# Copyright (C) 2010-2022 Cédric Bonhomme - https://www.cedricbonhomme.org
# Copyright (C) 2010-2023 Cédric Bonhomme - https://www.cedricbonhomme.org
#
# For more information : https://git.sr.ht/~cedric/stegano
#
Expand All @@ -24,9 +24,7 @@
__license__ = "GPLv3"

import typing

from collections import Counter
from collections import OrderedDict
from collections import Counter, OrderedDict


def steganalyse(img):
Expand Down
2 changes: 1 addition & 1 deletion stegano/tools.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env python
# Stegano - Stegano is a pure Python steganography module.
# Copyright (C) 2010-2022 Cédric Bonhomme - https://www.cedricbonhomme.org
# Copyright (C) 2010-2023 Cédric Bonhomme - https://www.cedricbonhomme.org
#
# For more information : https://git.sr.ht/~cedric/stegano
#
Expand Down
6 changes: 2 additions & 4 deletions tests/test_exifHeader.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-

# Stegano - Stegano is a pure Python steganography module.
# Copyright (C) 2010-2022 Cédric Bonhomme - https://www.cedricbonhomme.org
# Copyright (C) 2010-2023 Cédric Bonhomme - https://www.cedricbonhomme.org
#
# For more information : https://git.sr.ht/~cedric/stegano
#
Expand All @@ -25,9 +23,9 @@
__revision__ = "$Date: 2017/01/18 $"
__license__ = "GPLv3"

import io
import os
import unittest
import io

from stegano import exifHeader

Expand Down
Loading

0 comments on commit 0537c13

Please sign in to comment.