From 2da196d14c58c6d5a8f402d2bcd5d9ef864b4a0d Mon Sep 17 00:00:00 2001 From: Paul Warren Date: Mon, 5 Aug 2019 22:53:26 +1000 Subject: [PATCH] README Updates, better readability in image generation --- README.md | 8 ++++++++ app.py | 17 +++++++++++++---- 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 906fe1a..b2be226 100644 --- a/README.md +++ b/README.md @@ -2,3 +2,11 @@ A silly web API to add entropy to images in an attempt to destroy any steganography curl -H "Content-Type: application/png" --data-binary @GPSPeedo1.png http://localhost:5002/desteg -o GPSPeedo1_Destegged.png + + +## Please don't use this! + + It won't actually work on anything but the most naive steganographic implementations. This silly project fails to remove steghide embedded data, for example. It did make the embedded message fail to be extracted from images processed through [steganography](https://github.com/teovoinea/steganography), which uses simple LSB modifications to the Alpha channel (as at August 2019). + + + diff --git a/app.py b/app.py index a6cdaef..751efb2 100644 --- a/app.py +++ b/app.py @@ -33,11 +33,20 @@ def post_desteg(): # Create an array the same size # Stuff it full of entropy if (input_image.mode == "RGBA"): - entropy_array = numpy.random.rand(input_image.size[1],input_image.size[0],4)*3 - entropy_image = Image.fromarray(entropy_array.astype('uint8'), mode="RGBA") + entropy_array = numpy.random.rand( + input_image.size[1], + input_image.size[0], + 4)*6 + entropy_image = Image.fromarray( + entropy_array.astype('uint8'), + mode="RGBA") elif (input_image.mode == "RGB"): - entropy_array = numpy.random.rand(input_image.size[1],input_image.size[0],3)*3 - entropy_image = Image.fromarray(entropy_array.astype('uint8'), mode="RGB") + entropy_array = numpy.random.rand( + input_image.size[1], + input_image.size[0], + 3)*6 + entropy_image = Image.fromarray( + entropy_array.astype('uint8'), mode="RGB") else: # Insert relevant error return here pass