Skip to contentSkip to conversation

package/python-stegano

PATCH New Jugurtha BELKALEM 3 participants 8 messages Sep 1, 2020 – Jan 6, 2022

lore
Share & tools
lore
#0 lore raw

cover package/python-stegano

Steganography is the art and science of writing hidden messages in such a way that no one, apart from the sender and intended recipient, suspects the existence of the message. Steganography is often used with cryptography.

Python-stegano allows to apply steganography easily on images and retrive hidden messages that were injected.

More about python-stegano is available at :
https://pypi.org/project/stegano/.

Jugurtha BELKALEM (3):
package/python-crayons : new package package/python-piexif : new package package/python-stegano : new package

 DEVELOPERS                                 |  3 +++
 package/Config.in                          |  3 +++
 package/python-crayons/Config.in           |  8 ++++++++
 package/python-crayons/python-crayons.hash |  5 +++++
 package/python-crayons/python-crayons.mk   | 14 ++++++++++++++
 package/python-piexif/Config.in            | 10 ++++++++++
 package/python-piexif/python-piexif.hash   |  3 +++
 package/python-piexif/python-piexif.mk     | 13 +++++++++++++
 package/python-stegano/Config.in           | 14 ++++++++++++++
 package/python-stegano/python-stegano.hash |  5 +++++
 package/python-stegano/python-stegano.mk   | 14 ++++++++++++++
 11 files changed, 92 insertions(+)
 create mode 100644 package/python-crayons/Config.in
 create mode 100644 package/python-crayons/python-crayons.hash
 create mode 100644 package/python-crayons/python-crayons.mk
 create mode 100644 package/python-piexif/Config.in
 create mode 100644 package/python-piexif/python-piexif.hash
 create mode 100644 package/python-piexif/python-piexif.mk
 create mode 100644 package/python-stegano/Config.in
 create mode 100644 package/python-stegano/python-stegano.hash
 create mode 100644 package/python-stegano/python-stegano.mk
Signature · 1 line
2.11.0
#1 lore raw

PATCH 1/3 package/python-crayons : new package

This module is really simple, it gives you
colored strings for terminal usage.

---
Notes :
- This package can be used optionally by python-stegano.
- This module has been tested with Python3.
- It has been checked with check-package :

   $ ./utils/check-package package/python-crayons/*
   27 lines processed
   0 warnings generated
 DEVELOPERS                                 |  1 +
 package/Config.in                          |  1 +
 package/python-crayons/Config.in           |  8 ++++++++
 package/python-crayons/python-crayons.hash |  5 +++++
 package/python-crayons/python-crayons.mk   | 14 ++++++++++++++
 5 files changed, 29 insertions(+)
 create mode 100644 package/python-crayons/Config.in
 create mode 100644 package/python-crayons/python-crayons.hash
 create mode 100644 package/python-crayons/python-crayons.mk
DEVELOPERS +1 -0
index 3c3dcda859..6357eba0bc 100644
@@ -1398,6 +1398,7 @@ N:	Joshua Henderson <[email protected]>
 F:	package/qt5/qt5wayland/
 
 N:	Jugurtha BELKALEM <[email protected]>
+F:	package/python-crayons/
 F:	package/python-cycler/
 F:	package/python-matplotlib/
 
package/Config.in +1 -0
index d7e79f4795..fee0a964d0 100644
@@ -920,6 +920,7 @@ menu "External python modules"
 	source "package/python-configshell-fb/Config.in"
 	source "package/python-constantly/Config.in"
 	source "package/python-couchdb/Config.in"
+	source "package/python-crayons/Config.in"
 	source "package/python-crc16/Config.in"
 	source "package/python-crcmod/Config.in"
 	source "package/python-crontab/Config.in"
package/python-crayons/Config.in new file +8 -0
new file mode 100644
index 0000000000..10f3ece009
@@ -0,0 +1,8 @@
+config BR2_PACKAGE_PYTHON_CRAYONS
+	bool "python-crayons"
+	depends on BR2_PACKAGE_PYTHON3
+	help
+	  This module is really simple, it gives you
+	  colored strings for terminal usage.
+
+	  https://pypi.org/project/crayons
package/python-crayons/python-crayons.hash new file +5 -0
new file mode 100644
index 0000000000..e3d6632169
@@ -0,0 +1,5 @@
+# md5, sha256 from https://pypi.org/pypi/crayons/json
+md5  88a79c854ce54bcbb8376d18a448d627  crayons-0.4.0.tar.gz
+sha256  bd33b7547800f2cfbd26b38431f9e64b487a7de74a947b0fafc89b45a601813f  crayons-0.4.0.tar.gz
+# Locally computed sha256 checksums
+sha256  7deeb137f78337fd1e2e3966a7896821c6ebff244200d009d3f4157246b5a457  LICENSE
package/python-crayons/python-crayons.mk new file +14 -0
new file mode 100644
index 0000000000..33562d097b
@@ -0,0 +1,14 @@
+################################################################################
+#
+# python-crayons
+#
+################################################################################
+
+PYTHON_CRAYONS_VERSION = 0.4.0
+PYTHON_CRAYONS_SOURCE = crayons-$(PYTHON_CRAYONS_VERSION).tar.gz
+PYTHON_CRAYONS_SITE = https://files.pythonhosted.org/packages/b8/6b/12a1dea724c82f1c19f410365d3e25356625b48e8009a7c3c9ec4c42488d
+PYTHON_CRAYONS_LICENSE = MIT
+PYTHON_CRAYONS_LICENSE_FILES = LICENSE
+PYTHON_CRAYONS_SETUP_TYPE = setuptools
+
+$(eval $(python-package))
Signature · 1 line
2.11.0
#2 lore raw

PATCH 1/3 package/python-crayons : new package

Quoted 4 lines · On Tue, 1 Sep 2020 16:37:29 +0200 Jugurtha BELKALEM…

This module is really simple, it gives you
colored strings for terminal usage.

Quoted 8 lines

---
Notes :
- This package can be used optionally by python-stegano.
- This module has been tested with Python3.
- It has been checked with check-package :

   $ ./utils/check-package package/python-crayons/*
   27 lines processed
   0 warnings generated

Applied to master, thanks.

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
#3 lore raw

PATCH 2/3 package/python-piexif : new package

In reply to Jugurtha BELKALEM

To simplify exif manipulations with Python. Writing, reading, and more.
Piexif is pure Python. To everywhere with Python.

---
Notes :
- This package is mandatory at runtime for python-stegano.
- This module has been tested with Python3.
- It has been checked with check-package :

   $ ./utils/check-package package/python-piexif/*
   26 lines processed
   0 warnings generated
 DEVELOPERS                               |  1 +
 package/Config.in                        |  1 +
 package/python-piexif/Config.in          | 10 ++++++++++
 package/python-piexif/python-piexif.hash |  3 +++
 package/python-piexif/python-piexif.mk   | 13 +++++++++++++
 5 files changed, 28 insertions(+)
 create mode 100644 package/python-piexif/Config.in
 create mode 100644 package/python-piexif/python-piexif.hash
 create mode 100644 package/python-piexif/python-piexif.mk
DEVELOPERS +1 -0
index 6357eba0bc..18411d638b 100644
@@ -1401,6 +1401,7 @@ N:	Jugurtha BELKALEM <[email protected]>
 F:	package/python-crayons/
 F:	package/python-cycler/
 F:	package/python-matplotlib/
+F:	package/python-piexif/
 
 N:	Juha Rantanen <[email protected]>
 F:	package/acsccid/
package/Config.in +1 -0
index fee0a964d0..7dac15254a 100644
@@ -1057,6 +1057,7 @@ menu "External python modules"
 	source "package/python-periphery/Config.in"
 	source "package/python-pexpect/Config.in"
 	source "package/python-pickleshare/Config.in"
+	source "package/python-piexif/Config.in"
 	source "package/python-pigpio/Config.in"
 	source "package/python-pillow/Config.in"
 	source "package/python-pip/Config.in"
package/python-piexif/Config.in new file +10 -0
new file mode 100644
index 0000000000..aad42cbaeb
@@ -0,0 +1,10 @@
+config BR2_PACKAGE_PYTHON_PIEXIF
+	bool "python-piexif"
+	depends on BR2_PACKAGE_PYTHON3
+	select BR2_PACKAGE_PYTHON_PILLOW
+	help
+	  To simplify exif manipulations with Python.
+	  Writing, reading, and more? Piexif is pure Python.
+	  To everywhere with Python.
+
+	  https://github.com/hMatoba/Piexif
package/python-piexif/python-piexif.hash new file +3 -0
new file mode 100644
index 0000000000..1d83511516
@@ -0,0 +1,3 @@
+# Locally computed sha256 checksums
+sha256	abfd9a67795e23d7a76f9407d60841efa68c5d6e43376b295bb821a30602c569  python-piexif-1.1.3.tar.gz
+sha256	c9d2e27b56e1c47bb99ffac43d61077019dc54015d5e34d0e84411cce3d1bbde  LICENSE.txt
package/python-piexif/python-piexif.mk new file +13 -0
new file mode 100644
index 0000000000..2ab15cd30c
@@ -0,0 +1,13 @@
+################################################################################
+#
+# python-piexif
+#
+################################################################################
+
+PYTHON_PIEXIF_VERSION = 1.1.3
+PYTHON_PIEXIF_SITE = $(call github,hMatoba,Piexif,$(PYTHON_PIEXIF_VERSION))
+PYTHON_PIEXIF_LICENSE = MIT
+PYTHON_PIEXIF_LICENSE_FILES = LICENSE.txt
+PYTHON_PIEXIF_SETUP_TYPE = setuptools
+
+$(eval $(python-package))
Signature · 1 line
2.11.0
#4 lore raw

PATCH 2/3 package/python-piexif : new package

package/python-piexif/Config.in line 4

Quoted 10 lines · On Tue, 1 Sep 2020 16:37:30 +0200 Jugurtha BELKALEM…
package/python-piexif/Config.in new file +4 -0
new file mode 100644
index 0000000000..aad42cbaeb
@@ -0,0 +1,10 @@
+config BR2_PACKAGE_PYTHON_PIEXIF
+	bool "python-piexif"
+	depends on BR2_PACKAGE_PYTHON3
+	select BR2_PACKAGE_PYTHON_PILLOW

Looking at the code, I didn't really see where pillow is mandatory. Apparently, you can pass images opened to pillow, but you don't have to. So I dropped this "select". Of course, if that's incorrect, let me know, and we can fix it.

package/python-piexif/Config.in line 8

Quoted 4 lines
package/python-piexif/Config.in new file +4 -0
+	help
+	  To simplify exif manipulations with Python.
+	  Writing, reading, and more? Piexif is pure Python.
+	  To everywhere with Python.

This description (from their github) is not super useful, I've instead taken the description from their documentation, which is a bit more sensible.

package/python-piexif/Config.in line 9

Quoted 1 line
package/python-piexif/Config.in new file +1 -0
+sha256	c9d2e27b56e1c47bb99ffac43d61077019dc54015d5e34d0e84411cce3d1bbde  LICENSE.txt

This hash was incorrect and didn't match the actual license file.

I fixed those issues, and applied. Thanks!

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
#5 lore raw

PATCH 3/3 package/python-stegano : new package

In reply to Jugurtha BELKALEM

Steganography is the art and science of writing hidden messages in such a way that no one , apart from the sender and intended recipient , suspects the existence of the message, a form of security through obscurity.
Steganography is often used with cryptography.

More about python-stegano is available at :
https://pypi.org/project/stegano/.

Stegano can be tested :

$ python3
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

from stegano import lsb
secret = lsb.hide("./image.png", "Hello World")
secret.save("./image-with-steganography.png")

To get back text :

Quoted 1 line
Quoted 1 line
Quoted 1 line

clear_message = lsb.reveal("./image-with-steganography")

---
Notes :
- This module has been tested with Python3.
- It has been checked with check-package :

   $ ./utils/check-package package/python-stegano/*
   33 lines processed
   0 warnings generated
 DEVELOPERS                                 |  1 +
 package/Config.in                          |  1 +
 package/python-stegano/Config.in           | 14 ++++++++++++++
 package/python-stegano/python-stegano.hash |  5 +++++
 package/python-stegano/python-stegano.mk   | 14 ++++++++++++++
 5 files changed, 35 insertions(+)
 create mode 100644 package/python-stegano/Config.in
 create mode 100644 package/python-stegano/python-stegano.hash
 create mode 100644 package/python-stegano/python-stegano.mk
DEVELOPERS +1 -0
index 18411d638b..fcb6526dad 100644
@@ -1402,6 +1402,7 @@ F:	package/python-crayons/
 F:	package/python-cycler/
 F:	package/python-matplotlib/
 F:	package/python-piexif/
+F:	package/python-stegano/
 
 N:	Juha Rantanen <[email protected]>
 F:	package/acsccid/
package/Config.in +1 -0
index 7dac15254a..40eb865256 100644
@@ -1169,6 +1169,7 @@ menu "External python modules"
 	source "package/python-sqlalchemy/Config.in"
 	source "package/python-sqliteschema/Config.in"
 	source "package/python-sqlparse/Config.in"
+	source "package/python-stegano/Config.in"
 	source "package/python-subprocess32/Config.in"
 	source "package/python-systemd/Config.in"
 	source "package/python-tabledata/Config.in"
package/python-stegano/Config.in new file +14 -0
new file mode 100644
index 0000000000..b0b209c5f8
@@ -0,0 +1,14 @@
+config BR2_PACKAGE_PYTHON_STEGANO
+	bool "python-stegano"
+	depends on BR2_PACKAGE_PYTHON3
+	select BR2_PACKAGE_JPEG #runtime
+	select BR2_PACKAGE_LIBXML2 #runtime
+	select BR2_PACKAGE_OPENJPEG #runtime
+	select BR2_PACKAGE_PYTHON_CRAYONS #runtime
+	select BR2_PACKAGE_PYTHON_PIEXIF #runtime
+	select BR2_PACKAGE_PYTHON_PILLOW #runtime
+	select BR2_PACKAGE_TIFF #runtime
+	help
+	  A pure Python Steganography module.
+
+	  https://github.com/itkach/mwscrape
package/python-stegano/python-stegano.hash new file +5 -0
new file mode 100644
index 0000000000..d823c1752e
@@ -0,0 +1,5 @@
+# md5, sha256 from https://pypi.org/pypi/stegano/json
+md5  c63deda6352232c12cc09a8fd3ffc4e1  stegano-0.9.8.tar.gz
+sha256  b22eaefd8c236b0579fc3cc7ea709d0154098c11d3a30a3b840daa2ca1e3aa8a  stegano-0.9.8.tar.gz
+# Locally computed sha256 checksums
+sha256  c53a65c2fd561c87eaabf1072ef5dcab8653042bc15308465f52413585eb6271  COPYING
package/python-stegano/python-stegano.mk new file +14 -0
new file mode 100644
index 0000000000..9ff2d94484
@@ -0,0 +1,14 @@
+################################################################################
+#
+# python-stegano
+#
+################################################################################
+
+PYTHON_STEGANO_VERSION = 0.9.8
+PYTHON_STEGANO_SOURCE = stegano-$(PYTHON_STEGANO_VERSION).tar.gz
+PYTHON_STEGANO_SITE = https://files.pythonhosted.org/packages/6d/43/e758084b67931731d09cb5ee4d877955f970e8c2e20be4b85ccd177bef35
+PYTHON_STEGANO_LICENSE = GPL-3.0+
+PYTHON_STEGANO_LICENSE_FILES = COPYING
+PYTHON_STEGANO_SETUP_TYPE = setuptools
+
+$(eval $(python-package))
Signature · 1 line
2.11.0
#6 lore raw

PATCH 3/3 package/python-stegano : new package

Hello Jugurtha,

Quoted 9 lines · On Tue, 1 Sep 2020 16:37:31 +0200 Jugurtha BELKALEM…

Steganography is the art and science of writing hidden messages in such a way that no one , apart from the sender and intended recipient , suspects the existence of the message, a form of security through obscurity.
Steganography is often used with cryptography.

More about python-stegano is available at :
https://pypi.org/project/stegano/.

Quoted 7 lines

Stegano can be tested :

$ python3
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

from stegano import lsb
secret = lsb.hide("./image.png", "Hello World")
secret.save("./image-with-steganography.png")

To get back text :

Quoted 1 line
Quoted 1 line
Quoted 1 line

clear_message = lsb.reveal("./image-with-steganography")

Not a strict requirement, but since you have a simple test case, what about adding a runtime test in support/testing/ ?

package/python-stegano/Config.in line 6

Quoted 12 lines
package/python-stegano/Config.in new file +6 -0
new file mode 100644
index 0000000000..b0b209c5f8
@@ -0,0 +1,14 @@
+config BR2_PACKAGE_PYTHON_STEGANO
+	bool "python-stegano"
+	depends on BR2_PACKAGE_PYTHON3
+	select BR2_PACKAGE_JPEG #runtime
+	select BR2_PACKAGE_LIBXML2 #runtime
+	select BR2_PACKAGE_OPENJPEG #runtime

Could you give more details about the dependency on those 3 libraries? Is it because python-pillow must be built with openjpeg support and jpeg support? Or is it just because in your situation, you were using jpg pictures?

What about the libxml2 dependency?

Best regards,

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
#7 lore raw

Re: [Buildroot] [PATCH 3/3] package/python-stegano : new package

Hello Jugurtha, Thomas,

Le 05/09/2020 à 23:25, Thomas Petazzoni a écrit :

Quoted 43 lines

Hello Jugurtha,

Quoted 9 lines · On Tue, 1 Sep 2020 16:37:31 +0200 Jugurtha BELKALEM…

Steganography is the art and science of writing hidden messages in such a way that no one , apart from the sender and intended recipient , suspects the existence of the message, a form of security through obscurity.
Steganography is often used with cryptography.

More about python-stegano is available at :
https://pypi.org/project/stegano/.

Quoted 7 lines

Stegano can be tested :

$ python3
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

from stegano import lsb
secret = lsb.hide("./image.png", "Hello World")
secret.save("./image-with-steganography.png")

To get back text :

Quoted 1 line
Quoted 1 line
Quoted 1 line

clear_message = lsb.reveal("./image-with-steganography")

Not a strict requirement, but since you have a simple test case, what about adding a runtime test in support/testing/ ?

package/python-stegano/Config.in line 6

Quoted 12 lines
package/python-stegano/Config.in new file +6 -0
new file mode 100644
index 0000000000..b0b209c5f8
@@ -0,0 +1,14 @@
+config BR2_PACKAGE_PYTHON_STEGANO
+	bool "python-stegano"
+	depends on BR2_PACKAGE_PYTHON3
+	select BR2_PACKAGE_JPEG #runtime
+	select BR2_PACKAGE_LIBXML2 #runtime
+	select BR2_PACKAGE_OPENJPEG #runtime

Could you give more details about the dependency on those 3 libraries? Is it because python-pillow must be built with openjpeg support and jpeg support? Or is it just because in your situation, you were using jpg pictures?

Quoted 1 line

What about the libxml2 dependency?

No reply since September 2020, I have marked this patch as "Changes Requested".

Best regards,
Romain

Quoted 5 lines

Best regards,

Thomas

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot