Giter VIP home page Giter VIP logo

cryptosteganography's Introduction

Cryptosteganography

image

image

image

Latest Version

Development Status

Python Versions

A python steganography module to store messages or files protected with AES-256 encryption inside an image.

Steganography is the art of concealing information within different types of media objects such as images or audio files, in such a way that no one, apart from the sender and intended recipient, suspects the existence of the message. By default steganography is a type of security through obscurity.

Additionally this module also enhance the security of the steganography through data encryption. The data concealed is encrypted using AES 256 encryption, a popular algorithm used in symmetric key cryptography.

Prerequisites

Python 3+

pip3

(Most Linux systems comes with python 3 installed by default).

Dependencies Installation (Ubuntu)

$ sudo apt-get install python3-pip

Dependencies Installation (MacOS)

To install Python3 I recommend use Homebrew package manager

The script will explain what changes it will make and prompt you before the installation begins.

$ ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

Edit your ~/.profile to include (if it is not already there)

export PATH=/usr/local/bin:/usr/local/sbin:$PATH

To install Python 3:

$ brew install python3

Installation

To install the package just run

$ pip3 install cryptosteganography

Usage

Use as a library in a python program

Store a message string inside an image

from cryptosteganography import CryptoSteganography

crypto_steganography = CryptoSteganography('My secret password key')

# Save the encrypted file inside the image
crypto_steganography.hide('input_image_name.jpg', 'output_image_file.png', 'My secret message')

secret = crypto_steganography.retrieve('output_image_file.png')

print(secret)
# My secret message

Store a binary file inside an image

Note: This only works if the concealed file size is smaller than the input image

from cryptosteganography import CryptoSteganography

message = None
with open('sample.mp3', "rb") as f:
    message = f.read()

crypto_steganography = CryptoSteganography('My secret password key')

# Save the encrypted file inside the image
crypto_steganography.hide('input_image_name.jpg', 'output_image_file.png', message)

# Retrieve the file ( the previous crypto_steganography instance could be used but I instantiate a brand new object
# with the same password key just to demonstrate that can it can be used to decrypt)
crypto_steganography = CryptoSteganography('My secret password key')
decrypted_bin = crypto_steganography.retrieve('output_image_file.png')

# Save the data to a new file
with open('decrypted_sample.mp3', 'wb') as f:
    f.write(secret_bin)

Use as a python program

Check help at command line prompt to learn how to use it.

$ cryptosteganography -h
usage: cryptosteganography [-h] {save,retrieve} ...

A python steganography script that save/retrieve a text/file (AES 256
encrypted) inside an image.

positional arguments:
  {save,retrieve}  sub-command help
    save           save help
    retrieve       retrieve help

optional arguments:
  -h, --help       show this help message and exit

Save sub command help

$ cryptosteganography save -h
usage: cryptosteganography save [-h] -i INPUT_IMAGE_FILE
                              (-m MESSAGE | -f MESSAGE_FILE) -o
                              OUTPUT_IMAGE_FILE

optional arguments:
  -h, --help            show this help message and exit
  -i INPUT_IMAGE_FILE, --input INPUT_IMAGE_FILE
                        Input image file.
  -m MESSAGE, --message MESSAGE
                        Your secret message to hide (non binary).
  -f MESSAGE_FILE, --file MESSAGE_FILE
                        Your secret to hide (Text or any binary file).
  -o OUTPUT_IMAGE_FILE, --output OUTPUT_IMAGE_FILE
                        Output image containing the secret.

Retrieve sub command help

$ cryptosteganography retrieve -h
usage: cryptosteganography retrieve [-h] -i INPUT_IMAGE_FILE [-o RETRIEVED_FILE]

optional arguments:
  -h, --help            show this help message and exit
  -i INPUT_IMAGE_FILE, --input INPUT_IMAGE_FILE
                        Input image file.
  -o RETRIEVED_FILE, --output RETRIEVED_FILE
                        Output for the binary secret file (Text or any binary
                        file).

Save message example

$ cryptosteganography save -i 4824157.png -m "My secret message..." -o output.png
Enter the key password:
Output image output.png saved with success

Retrieve message example

$ cryptosteganography retrieve -i output.png
Enter the key password: 
My secret message...

Save file example

$ cryptosteganography save -i input_image_name.jpg -f duck_logo.pem -o output_file.png
Enter the key password:
Output image output_file.png saved with success

Retrieve file example

$ cryptosteganography retrieve -i output.png -o decrypted_file
Enter the key password: 
decrypted_file saved with success

License

This project is licensed under the MIT License - see the LICENSE file for details

Authors

Vin Busquet file for details

Limitations

  • Only works with python 3
  • It does not work if the conceived file is greater than original input file
  • Output image is limited to PNG format only.
  • I did not tested with all conceived file types. Feel free to report any bug you find

Contributing

For details, check out CONTRIBUTING.md.

Changelog

For details, check out CHANGELOG.md.

Acknowledgments

cryptosteganography's People

Contributors

0xflotus avatar computationalcore avatar dependabot[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

cryptosteganography's Issues

IndexError: Impossible to detect message.

crypto_steganography = CryptoSteganography('My secret password key')

# Save the encrypted file inside the image
crypto_steganography.hide('image_2023-06-10_06-30-52.jpg', 'image_2023-06-10_06-30-52_b.jpg', 'ssssss=')

secret = crypto_steganography.retrieve('image_2023-06-10_06-30-52_b.jpg')

results in:

File "/usr/local/lib/python3.8/dist-packages/cryptosteganography/__init__.py", line 62, in retrieve
    cypher_data = lsb.reveal(input_image_file)
  File "/usr/local/lib/python3.8/dist-packages/stegano/lsb/lsb.py", line 88, in reveal
    if revealer.decode_pixel((col, row)):
  File "/usr/local/lib/python3.8/dist-packages/stegano/tools.py", line 205, in decode_pixel
    raise IndexError("Impossible to detect message.")
IndexError: Impossible to detect message.

Version 0.8.3
Ubuntu 22.04
python 3.8
pillow 6.2.2

Installing problem on MacBookPro4,1 Catalina 10.15.7 (dosdude1 patched)

I tried a few times to install while manually installing Pillow and also updating my homebrew installation, but install cryptosteganography always stops installing where the first problematic part seems to be that one:

Building wheels for collected packages: pillow
  Building wheel for pillow (setup.py) ... error
  ERROR: Command errored out with exit status 1:
   command: /usr/local/opt/[email protected]/bin/python3.9 -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/cr/_2_0z19n6jn54958c_6vc7xm0000gn/T/pip-install-y3h4_a3u/pillow_f118b79644e544f8920affeb1081f4af/setup.py'"'"'; __file__='"'"'/private/var/folders/cr/_2_0z19n6jn54958c_6vc7xm0000gn/T/pip-install-y3h4_a3u/pillow_f118b79644e544f8920affeb1081f4af/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /private/var/folders/cr/_2_0z19n6jn54958c_6vc7xm0000gn/T/pip-wheel-wygfsmd5
       cwd: /private/var/folders/cr/_2_0z19n6jn54958c_6vc7xm0000gn/T/pip-install-y3h4_a3u/pillow_f118b79644e544f8920affeb1081f4af/

Could it be that my version of Pillow is to new? Should I maybe change the requirements.txt, but when using the default installation method I can’t change the sources, or? (Sorry, I’m quite the newbie in regards to the vast Python universe ;-)

In the past I also had a few issues with installing Python3 and some other dependencies when installing via homebrew. I think it was cause of homebrew expecting at least: nehalem processor architecture and this machine (MacBookPro4,1) still only has a Penryn processor. I could work around this problem with making two changes to the hardware.rb file (replacing "nehalem" with "core2") and reinstalling/compiling some dependencies from source, not using the bottled versions.

the full error messages output log reads:

robo@mbx ~ % pip3 install cryptosteganography
DEPRECATION: Configuring installation scheme with distutils config files is deprecated and will no longer work in the near future. If you are using a Homebrew or Linuxbrew Python, please see discussion at https://github.com/Homebrew/homebrew-core/issues/76621
Collecting cryptosteganography
  Using cached cryptosteganography-0.8.3-py3-none-any.whl
Collecting piexif==1.1.3
  Using cached piexif-1.1.3-py2.py3-none-any.whl (20 kB)
Collecting stegano>=0.9.7
  Using cached stegano-0.10.1-py3-none-any.whl (301 kB)
Collecting pillow==6.2.2
  Using cached Pillow-6.2.2.tar.gz (37.8 MB)
  Preparing metadata (setup.py) ... done
Collecting pycryptodomex==3.9.7
  Using cached pycryptodomex-3.9.7-cp39-cp39-macosx_10_15_x86_64.whl
Collecting crayons==0.3.0
  Using cached crayons-0.3.0-py2.py3-none-any.whl (4.6 kB)
Requirement already satisfied: colorama>=0.4.2 in /usr/local/lib/python3.9/site-packages (from cryptosteganography) (0.4.4)
Collecting exitstatus==1.4.0
  Using cached exitstatus-1.4.0-py2.py3-none-any.whl (3.2 kB)
Collecting stegano>=0.9.7
  Using cached stegano-0.10.0-py3-none-any.whl (301 kB)
Collecting opencv-python<5.0.0,>=4.5.0
  Using cached opencv_python-4.5.5.62-cp36-abi3-macosx_10_15_x86_64.whl (46.0 MB)
Collecting stegano>=0.9.7
  Using cached stegano-0.9.9-py3-none-any.whl (301 kB)
  Using cached stegano-0.9.8-py3-none-any.whl (300 kB)
Building wheels for collected packages: pillow
  Building wheel for pillow (setup.py) ... error
  ERROR: Command errored out with exit status 1:
   command: /usr/local/opt/[email protected]/bin/python3.9 -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/cr/_2_0z19n6jn54958c_6vc7xm0000gn/T/pip-install-y3h4_a3u/pillow_f118b79644e544f8920affeb1081f4af/setup.py'"'"'; __file__='"'"'/private/var/folders/cr/_2_0z19n6jn54958c_6vc7xm0000gn/T/pip-install-y3h4_a3u/pillow_f118b79644e544f8920affeb1081f4af/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /private/var/folders/cr/_2_0z19n6jn54958c_6vc7xm0000gn/T/pip-wheel-wygfsmd5
       cwd: /private/var/folders/cr/_2_0z19n6jn54958c_6vc7xm0000gn/T/pip-install-y3h4_a3u/pillow_f118b79644e544f8920affeb1081f4af/
  Complete output (173 lines):
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.macosx-10.15-x86_64-3.9
  creating build/lib.macosx-10.15-x86_64-3.9/PIL
  copying src/PIL/MpoImagePlugin.py -> build/lib.macosx-10.15-x86_64-3.9/PIL
  copying src/PIL/ImageMode.py -> build/lib.macosx-10.15-x86_64-3.9/PIL
  copying src/PIL/PngImagePlugin.py -> build/lib.macosx-10.15-x86_64-3.9/PIL
  copying src/PIL/XbmImagePlugin.py -> build/lib.macosx-10.15-x86_64-3.9/PIL
  copying src/PIL/PcxImagePlugin.py -> build/lib.macosx-10.15-x86_64-3.9/PIL
  copying src/PIL/SunImagePlugin.py -> build/lib.macosx-10.15-x86_64-3.9/PIL
  copying src/PIL/ImageFile.py -> build/lib.macosx-10.15-x86_64-3.9/PIL
  copying src/PIL/SpiderImagePlugin.py -> build/lib.macosx-10.15-x86_64-3.9/PIL
  copying src/PIL/TarIO.py -> build/lib.macosx-10.15-x86_64-3.9/PIL
  copying src/PIL/FitsStubImagePlugin.py -> build/lib.macosx-10.15-x86_64-3.9/PIL
  copying src/PIL/MpegImagePlugin.py -> build/lib.macosx-10.15-x86_64-3.9/PIL
  copying src/PIL/BdfFontFile.py -> build/lib.macosx-10.15-x86_64-3.9/PIL
  copying src/PIL/GribStubImagePlugin.py -> build/lib.macosx-10.15-x86_64-3.9/PIL
  copying src/PIL/ImageStat.py -> build/lib.macosx-10.15-x86_64-3.9/PIL
  copying src/PIL/PixarImagePlugin.py -> build/lib.macosx-10.15-x86_64-3.9/PIL
  copying src/PIL/GimpPaletteFile.py -> build/lib.macosx-10.15-x86_64-3.9/PIL
  copying src/PIL/ImageColor.py -> build/lib.macosx-10.15-x86_64-3.9/PIL
  copying src/PIL/ContainerIO.py -> build/lib.macosx-10.15-x86_64-3.9/PIL
  copying src/PIL/MspImagePlugin.py -> build/lib.macosx-10.15-x86_64-3.9/PIL
  copying src/PIL/MicImagePlugin.py -> build/lib.macosx-10.15-x86_64-3.9/PIL
  copying src/PIL/_version.py -> build/lib.macosx-10.15-x86_64-3.9/PIL
  copying src/PIL/ImtImagePlugin.py -> build/lib.macosx-10.15-x86_64-3.9/PIL
  copying src/PIL/GifImagePlugin.py -> build/lib.macosx-10.15-x86_64-3.9/PIL
  copying src/PIL/PalmImagePlugin.py -> build/lib.macosx-10.15-x86_64-3.9/PIL
  copying src/PIL/ImageQt.py -> build/lib.macosx-10.15-x86_64-3.9/PIL
  copying src/PIL/ImageMath.py -> build/lib.macosx-10.15-x86_64-3.9/PIL
  copying src/PIL/PaletteFile.py -> build/lib.macosx-10.15-x86_64-3.9/PIL
  copying src/PIL/FontFile.py -> build/lib.macosx-10.15-x86_64-3.9/PIL
  copying src/PIL/PdfParser.py -> build/lib.macosx-10.15-x86_64-3.9/PIL
  copying src/PIL/ExifTags.py -> build/lib.macosx-10.15-x86_64-3.9/PIL
  copying src/PIL/ImageCms.py -> build/lib.macosx-10.15-x86_64-3.9/PIL
  copying src/PIL/FpxImagePlugin.py -> build/lib.macosx-10.15-x86_64-3.9/PIL
  copying src/PIL/ImageChops.py -> build/lib.macosx-10.15-x86_64-3.9/PIL
  copying src/PIL/BufrStubImagePlugin.py -> build/lib.macosx-10.15-x86_64-3.9/PIL
  copying src/PIL/PSDraw.py -> build/lib.macosx-10.15-x86_64-3.9/PIL
  copying src/PIL/PcdImagePlugin.py -> build/lib.macosx-10.15-x86_64-3.9/PIL
  copying src/PIL/ImageFilter.py -> build/lib.macosx-10.15-x86_64-3.9/PIL
  copying src/PIL/ImageDraw2.py -> build/lib.macosx-10.15-x86_64-3.9/PIL
  copying src/PIL/ImagePath.py -> build/lib.macosx-10.15-x86_64-3.9/PIL
  copying src/PIL/DcxImagePlugin.py -> build/lib.macosx-10.15-x86_64-3.9/PIL
  copying src/PIL/__init__.py -> build/lib.macosx-10.15-x86_64-3.9/PIL
  copying src/PIL/JpegPresets.py -> build/lib.macosx-10.15-x86_64-3.9/PIL
  copying src/PIL/Hdf5StubImagePlugin.py -> build/lib.macosx-10.15-x86_64-3.9/PIL
  copying src/PIL/features.py -> build/lib.macosx-10.15-x86_64-3.9/PIL
  copying src/PIL/ImageDraw.py -> build/lib.macosx-10.15-x86_64-3.9/PIL
  copying src/PIL/GimpGradientFile.py -> build/lib.macosx-10.15-x86_64-3.9/PIL
  copying src/PIL/ImageWin.py -> build/lib.macosx-10.15-x86_64-3.9/PIL
  copying src/PIL/IcoImagePlugin.py -> build/lib.macosx-10.15-x86_64-3.9/PIL
  copying src/PIL/_tkinter_finder.py -> build/lib.macosx-10.15-x86_64-3.9/PIL
  copying src/PIL/EpsImagePlugin.py -> build/lib.macosx-10.15-x86_64-3.9/PIL
  copying src/PIL/TgaImagePlugin.py -> build/lib.macosx-10.15-x86_64-3.9/PIL
  copying src/PIL/ImageMorph.py -> build/lib.macosx-10.15-x86_64-3.9/PIL
  copying src/PIL/Jpeg2KImagePlugin.py -> build/lib.macosx-10.15-x86_64-3.9/PIL
  copying src/PIL/WalImageFile.py -> build/lib.macosx-10.15-x86_64-3.9/PIL
  copying src/PIL/PcfFontFile.py -> build/lib.macosx-10.15-x86_64-3.9/PIL
  copying src/PIL/BlpImagePlugin.py -> build/lib.macosx-10.15-x86_64-3.9/PIL
  copying src/PIL/ImageTk.py -> build/lib.macosx-10.15-x86_64-3.9/PIL
  copying src/PIL/GbrImagePlugin.py -> build/lib.macosx-10.15-x86_64-3.9/PIL
  copying src/PIL/ImageOps.py -> build/lib.macosx-10.15-x86_64-3.9/PIL
  copying src/PIL/PdfImagePlugin.py -> build/lib.macosx-10.15-x86_64-3.9/PIL
  copying src/PIL/ImageShow.py -> build/lib.macosx-10.15-x86_64-3.9/PIL
  copying src/PIL/ImageEnhance.py -> build/lib.macosx-10.15-x86_64-3.9/PIL
  copying src/PIL/WmfImagePlugin.py -> build/lib.macosx-10.15-x86_64-3.9/PIL
  copying src/PIL/ImageGrab.py -> build/lib.macosx-10.15-x86_64-3.9/PIL
  copying src/PIL/WebPImagePlugin.py -> build/lib.macosx-10.15-x86_64-3.9/PIL
  copying src/PIL/FliImagePlugin.py -> build/lib.macosx-10.15-x86_64-3.9/PIL
  copying src/PIL/TiffTags.py -> build/lib.macosx-10.15-x86_64-3.9/PIL
  copying src/PIL/CurImagePlugin.py -> build/lib.macosx-10.15-x86_64-3.9/PIL
  copying src/PIL/_util.py -> build/lib.macosx-10.15-x86_64-3.9/PIL
  copying src/PIL/GdImageFile.py -> build/lib.macosx-10.15-x86_64-3.9/PIL
  copying src/PIL/TiffImagePlugin.py -> build/lib.macosx-10.15-x86_64-3.9/PIL
  copying src/PIL/IptcImagePlugin.py -> build/lib.macosx-10.15-x86_64-3.9/PIL
  copying src/PIL/ImagePalette.py -> build/lib.macosx-10.15-x86_64-3.9/PIL
  copying src/PIL/BmpImagePlugin.py -> build/lib.macosx-10.15-x86_64-3.9/PIL
  copying src/PIL/ImageTransform.py -> build/lib.macosx-10.15-x86_64-3.9/PIL
  copying src/PIL/IcnsImagePlugin.py -> build/lib.macosx-10.15-x86_64-3.9/PIL
  copying src/PIL/McIdasImagePlugin.py -> build/lib.macosx-10.15-x86_64-3.9/PIL
  copying src/PIL/XpmImagePlugin.py -> build/lib.macosx-10.15-x86_64-3.9/PIL
  copying src/PIL/DdsImagePlugin.py -> build/lib.macosx-10.15-x86_64-3.9/PIL
  copying src/PIL/ImageSequence.py -> build/lib.macosx-10.15-x86_64-3.9/PIL
  copying src/PIL/PyAccess.py -> build/lib.macosx-10.15-x86_64-3.9/PIL
  copying src/PIL/_binary.py -> build/lib.macosx-10.15-x86_64-3.9/PIL
  copying src/PIL/Image.py -> build/lib.macosx-10.15-x86_64-3.9/PIL
  copying src/PIL/__main__.py -> build/lib.macosx-10.15-x86_64-3.9/PIL
  copying src/PIL/XVThumbImagePlugin.py -> build/lib.macosx-10.15-x86_64-3.9/PIL
  copying src/PIL/SgiImagePlugin.py -> build/lib.macosx-10.15-x86_64-3.9/PIL
  copying src/PIL/ImImagePlugin.py -> build/lib.macosx-10.15-x86_64-3.9/PIL
  copying src/PIL/PsdImagePlugin.py -> build/lib.macosx-10.15-x86_64-3.9/PIL
  copying src/PIL/JpegImagePlugin.py -> build/lib.macosx-10.15-x86_64-3.9/PIL
  copying src/PIL/ImageFont.py -> build/lib.macosx-10.15-x86_64-3.9/PIL
  copying src/PIL/PpmImagePlugin.py -> build/lib.macosx-10.15-x86_64-3.9/PIL
  copying src/PIL/FtexImagePlugin.py -> build/lib.macosx-10.15-x86_64-3.9/PIL
  running egg_info
  writing src/Pillow.egg-info/PKG-INFO
  writing dependency_links to src/Pillow.egg-info/dependency_links.txt
  writing top-level names to src/Pillow.egg-info/top_level.txt
  reading manifest file 'src/Pillow.egg-info/SOURCES.txt'
  reading manifest template 'MANIFEST.in'
  warning: no files found matching '*.c'
  warning: no files found matching '*.h'
  warning: no files found matching '*.sh'
  warning: no previously-included files found matching '.appveyor.yml'
  warning: no previously-included files found matching '.coveragerc'
  warning: no previously-included files found matching '.codecov.yml'
  warning: no previously-included files found matching '.editorconfig'
  warning: no previously-included files found matching '.readthedocs.yml'
  warning: no previously-included files found matching 'azure-pipelines.yml'
  warning: no previously-included files matching '.git*' found anywhere in distribution
  warning: no previously-included files matching '*.pyc' found anywhere in distribution
  warning: no previously-included files matching '*.so' found anywhere in distribution
  no previously-included directories found matching '.azure-pipelines'
  no previously-included directories found matching '.travis'
  adding license file 'LICENSE'
  writing manifest file 'src/Pillow.egg-info/SOURCES.txt'
  running build_ext
  
  
  The headers or library files could not be found for zlib,
  a required dependency when compiling Pillow from source.
  
  Please see the install instructions at:
     https://pillow.readthedocs.io/en/latest/installation.html
  
  Traceback (most recent call last):
    File "/private/var/folders/cr/_2_0z19n6jn54958c_6vc7xm0000gn/T/pip-install-y3h4_a3u/pillow_f118b79644e544f8920affeb1081f4af/setup.py", line 852, in <module>
      setup(
    File "/usr/local/lib/python3.9/site-packages/setuptools/__init__.py", line 159, in setup
      return distutils.core.setup(**attrs)
    File "/usr/local/Cellar/[email protected]/3.9.9/Frameworks/Python.framework/Versions/3.9/lib/python3.9/distutils/core.py", line 148, in setup
      dist.run_commands()
    File "/usr/local/Cellar/[email protected]/3.9.9/Frameworks/Python.framework/Versions/3.9/lib/python3.9/distutils/dist.py", line 966, in run_commands
      self.run_command(cmd)
    File "/usr/local/Cellar/[email protected]/3.9.9/Frameworks/Python.framework/Versions/3.9/lib/python3.9/distutils/dist.py", line 985, in run_command
      cmd_obj.run()
    File "/usr/local/lib/python3.9/site-packages/wheel/bdist_wheel.py", line 299, in run
      self.run_command('build')
    File "/usr/local/Cellar/[email protected]/3.9.9/Frameworks/Python.framework/Versions/3.9/lib/python3.9/distutils/cmd.py", line 313, in run_command
      self.distribution.run_command(command)
    File "/usr/local/Cellar/[email protected]/3.9.9/Frameworks/Python.framework/Versions/3.9/lib/python3.9/distutils/dist.py", line 985, in run_command
      cmd_obj.run()
    File "/usr/local/Cellar/[email protected]/3.9.9/Frameworks/Python.framework/Versions/3.9/lib/python3.9/distutils/command/build.py", line 135, in run
      self.run_command(cmd_name)
    File "/usr/local/Cellar/[email protected]/3.9.9/Frameworks/Python.framework/Versions/3.9/lib/python3.9/distutils/cmd.py", line 313, in run_command
      self.distribution.run_command(command)
    File "/usr/local/Cellar/[email protected]/3.9.9/Frameworks/Python.framework/Versions/3.9/lib/python3.9/distutils/dist.py", line 985, in run_command
      cmd_obj.run()
    File "/usr/local/Cellar/[email protected]/3.9.9/Frameworks/Python.framework/Versions/3.9/lib/python3.9/distutils/command/build_ext.py", line 340, in run
      self.build_extensions()
    File "/private/var/folders/cr/_2_0z19n6jn54958c_6vc7xm0000gn/T/pip-install-y3h4_a3u/pillow_f118b79644e544f8920affeb1081f4af/setup.py", line 687, in build_extensions
      raise RequiredDependencyException(f)
  __main__.RequiredDependencyException: zlib
  
  During handling of the above exception, another exception occurred:
  
  Traceback (most recent call last):
    File "<string>", line 1, in <module>
    File "/private/var/folders/cr/_2_0z19n6jn54958c_6vc7xm0000gn/T/pip-install-y3h4_a3u/pillow_f118b79644e544f8920affeb1081f4af/setup.py", line 903, in <module>
      raise RequiredDependencyException(msg)
  __main__.RequiredDependencyException:
  
  The headers or library files could not be found for zlib,
  a required dependency when compiling Pillow from source.
  
  Please see the install instructions at:
     https://pillow.readthedocs.io/en/latest/installation.html
  
  
  ----------------------------------------
  ERROR: Failed building wheel for pillow
  Running setup.py clean for pillow
Failed to build pillow
Installing collected packages: pillow, piexif, crayons, stegano, pycryptodomex, exitstatus, cryptosteganography
  Attempting uninstall: pillow
    Found existing installation: Pillow 9.0.0
    Uninstalling Pillow-9.0.0:
      Successfully uninstalled Pillow-9.0.0
    Running setup.py install for pillow ... error
    ERROR: Command errored out with exit status 1:
     command: /usr/local/opt/[email protected]/bin/python3.9 -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/cr/_2_0z19n6jn54958c_6vc7xm0000gn/T/pip-install-y3h4_a3u/pillow_f118b79644e544f8920affeb1081f4af/setup.py'"'"'; __file__='"'"'/private/var/folders/cr/_2_0z19n6jn54958c_6vc7xm0000gn/T/pip-install-y3h4_a3u/pillow_f118b79644e544f8920affeb1081f4af/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/var/folders/cr/_2_0z19n6jn54958c_6vc7xm0000gn/T/pip-record-j_6b2nhm/install-record.txt --single-version-externally-managed --compile --install-headers /usr/local/include/python3.9/pillow
         cwd: /private/var/folders/cr/_2_0z19n6jn54958c_6vc7xm0000gn/T/pip-install-y3h4_a3u/pillow_f118b79644e544f8920affeb1081f4af/
    Complete output (177 lines):
    running install
    /usr/local/lib/python3.9/site-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
      warnings.warn(
    running build
    running build_py
    creating build
    creating build/lib.macosx-10.15-x86_64-3.9
    creating build/lib.macosx-10.15-x86_64-3.9/PIL
    copying src/PIL/MpoImagePlugin.py -> build/lib.macosx-10.15-x86_64-3.9/PIL
    copying src/PIL/ImageMode.py -> build/lib.macosx-10.15-x86_64-3.9/PIL
    copying src/PIL/PngImagePlugin.py -> build/lib.macosx-10.15-x86_64-3.9/PIL
    copying src/PIL/XbmImagePlugin.py -> build/lib.macosx-10.15-x86_64-3.9/PIL
    copying src/PIL/PcxImagePlugin.py -> build/lib.macosx-10.15-x86_64-3.9/PIL
    copying src/PIL/SunImagePlugin.py -> build/lib.macosx-10.15-x86_64-3.9/PIL
    copying src/PIL/ImageFile.py -> build/lib.macosx-10.15-x86_64-3.9/PIL
    copying src/PIL/SpiderImagePlugin.py -> build/lib.macosx-10.15-x86_64-3.9/PIL
    copying src/PIL/TarIO.py -> build/lib.macosx-10.15-x86_64-3.9/PIL
    copying src/PIL/FitsStubImagePlugin.py -> build/lib.macosx-10.15-x86_64-3.9/PIL
    copying src/PIL/MpegImagePlugin.py -> build/lib.macosx-10.15-x86_64-3.9/PIL
    copying src/PIL/BdfFontFile.py -> build/lib.macosx-10.15-x86_64-3.9/PIL
    copying src/PIL/GribStubImagePlugin.py -> build/lib.macosx-10.15-x86_64-3.9/PIL
    copying src/PIL/ImageStat.py -> build/lib.macosx-10.15-x86_64-3.9/PIL
    copying src/PIL/PixarImagePlugin.py -> build/lib.macosx-10.15-x86_64-3.9/PIL
    copying src/PIL/GimpPaletteFile.py -> build/lib.macosx-10.15-x86_64-3.9/PIL
    copying src/PIL/ImageColor.py -> build/lib.macosx-10.15-x86_64-3.9/PIL
    copying src/PIL/ContainerIO.py -> build/lib.macosx-10.15-x86_64-3.9/PIL
    copying src/PIL/MspImagePlugin.py -> build/lib.macosx-10.15-x86_64-3.9/PIL
    copying src/PIL/MicImagePlugin.py -> build/lib.macosx-10.15-x86_64-3.9/PIL
    copying src/PIL/_version.py -> build/lib.macosx-10.15-x86_64-3.9/PIL
    copying src/PIL/ImtImagePlugin.py -> build/lib.macosx-10.15-x86_64-3.9/PIL
    copying src/PIL/GifImagePlugin.py -> build/lib.macosx-10.15-x86_64-3.9/PIL
    copying src/PIL/PalmImagePlugin.py -> build/lib.macosx-10.15-x86_64-3.9/PIL
    copying src/PIL/ImageQt.py -> build/lib.macosx-10.15-x86_64-3.9/PIL
    copying src/PIL/ImageMath.py -> build/lib.macosx-10.15-x86_64-3.9/PIL
    copying src/PIL/PaletteFile.py -> build/lib.macosx-10.15-x86_64-3.9/PIL
    copying src/PIL/FontFile.py -> build/lib.macosx-10.15-x86_64-3.9/PIL
    copying src/PIL/PdfParser.py -> build/lib.macosx-10.15-x86_64-3.9/PIL
    copying src/PIL/ExifTags.py -> build/lib.macosx-10.15-x86_64-3.9/PIL
    copying src/PIL/ImageCms.py -> build/lib.macosx-10.15-x86_64-3.9/PIL
    copying src/PIL/FpxImagePlugin.py -> build/lib.macosx-10.15-x86_64-3.9/PIL
    copying src/PIL/ImageChops.py -> build/lib.macosx-10.15-x86_64-3.9/PIL
    copying src/PIL/BufrStubImagePlugin.py -> build/lib.macosx-10.15-x86_64-3.9/PIL
    copying src/PIL/PSDraw.py -> build/lib.macosx-10.15-x86_64-3.9/PIL
    copying src/PIL/PcdImagePlugin.py -> build/lib.macosx-10.15-x86_64-3.9/PIL
    copying src/PIL/ImageFilter.py -> build/lib.macosx-10.15-x86_64-3.9/PIL
    copying src/PIL/ImageDraw2.py -> build/lib.macosx-10.15-x86_64-3.9/PIL
    copying src/PIL/ImagePath.py -> build/lib.macosx-10.15-x86_64-3.9/PIL
    copying src/PIL/DcxImagePlugin.py -> build/lib.macosx-10.15-x86_64-3.9/PIL
    copying src/PIL/__init__.py -> build/lib.macosx-10.15-x86_64-3.9/PIL
    copying src/PIL/JpegPresets.py -> build/lib.macosx-10.15-x86_64-3.9/PIL
    copying src/PIL/Hdf5StubImagePlugin.py -> build/lib.macosx-10.15-x86_64-3.9/PIL
    copying src/PIL/features.py -> build/lib.macosx-10.15-x86_64-3.9/PIL
    copying src/PIL/ImageDraw.py -> build/lib.macosx-10.15-x86_64-3.9/PIL
    copying src/PIL/GimpGradientFile.py -> build/lib.macosx-10.15-x86_64-3.9/PIL
    copying src/PIL/ImageWin.py -> build/lib.macosx-10.15-x86_64-3.9/PIL
    copying src/PIL/IcoImagePlugin.py -> build/lib.macosx-10.15-x86_64-3.9/PIL
    copying src/PIL/_tkinter_finder.py -> build/lib.macosx-10.15-x86_64-3.9/PIL
    copying src/PIL/EpsImagePlugin.py -> build/lib.macosx-10.15-x86_64-3.9/PIL
    copying src/PIL/TgaImagePlugin.py -> build/lib.macosx-10.15-x86_64-3.9/PIL
    copying src/PIL/ImageMorph.py -> build/lib.macosx-10.15-x86_64-3.9/PIL
    copying src/PIL/Jpeg2KImagePlugin.py -> build/lib.macosx-10.15-x86_64-3.9/PIL
    copying src/PIL/WalImageFile.py -> build/lib.macosx-10.15-x86_64-3.9/PIL
    copying src/PIL/PcfFontFile.py -> build/lib.macosx-10.15-x86_64-3.9/PIL
    copying src/PIL/BlpImagePlugin.py -> build/lib.macosx-10.15-x86_64-3.9/PIL
    copying src/PIL/ImageTk.py -> build/lib.macosx-10.15-x86_64-3.9/PIL
    copying src/PIL/GbrImagePlugin.py -> build/lib.macosx-10.15-x86_64-3.9/PIL
    copying src/PIL/ImageOps.py -> build/lib.macosx-10.15-x86_64-3.9/PIL
    copying src/PIL/PdfImagePlugin.py -> build/lib.macosx-10.15-x86_64-3.9/PIL
    copying src/PIL/ImageShow.py -> build/lib.macosx-10.15-x86_64-3.9/PIL
    copying src/PIL/ImageEnhance.py -> build/lib.macosx-10.15-x86_64-3.9/PIL
    copying src/PIL/WmfImagePlugin.py -> build/lib.macosx-10.15-x86_64-3.9/PIL
    copying src/PIL/ImageGrab.py -> build/lib.macosx-10.15-x86_64-3.9/PIL
    copying src/PIL/WebPImagePlugin.py -> build/lib.macosx-10.15-x86_64-3.9/PIL
    copying src/PIL/FliImagePlugin.py -> build/lib.macosx-10.15-x86_64-3.9/PIL
    copying src/PIL/TiffTags.py -> build/lib.macosx-10.15-x86_64-3.9/PIL
    copying src/PIL/CurImagePlugin.py -> build/lib.macosx-10.15-x86_64-3.9/PIL
    copying src/PIL/_util.py -> build/lib.macosx-10.15-x86_64-3.9/PIL
    copying src/PIL/GdImageFile.py -> build/lib.macosx-10.15-x86_64-3.9/PIL
    copying src/PIL/TiffImagePlugin.py -> build/lib.macosx-10.15-x86_64-3.9/PIL
    copying src/PIL/IptcImagePlugin.py -> build/lib.macosx-10.15-x86_64-3.9/PIL
    copying src/PIL/ImagePalette.py -> build/lib.macosx-10.15-x86_64-3.9/PIL
    copying src/PIL/BmpImagePlugin.py -> build/lib.macosx-10.15-x86_64-3.9/PIL
    copying src/PIL/ImageTransform.py -> build/lib.macosx-10.15-x86_64-3.9/PIL
    copying src/PIL/IcnsImagePlugin.py -> build/lib.macosx-10.15-x86_64-3.9/PIL
    copying src/PIL/McIdasImagePlugin.py -> build/lib.macosx-10.15-x86_64-3.9/PIL
    copying src/PIL/XpmImagePlugin.py -> build/lib.macosx-10.15-x86_64-3.9/PIL
    copying src/PIL/DdsImagePlugin.py -> build/lib.macosx-10.15-x86_64-3.9/PIL
    copying src/PIL/ImageSequence.py -> build/lib.macosx-10.15-x86_64-3.9/PIL
    copying src/PIL/PyAccess.py -> build/lib.macosx-10.15-x86_64-3.9/PIL
    copying src/PIL/_binary.py -> build/lib.macosx-10.15-x86_64-3.9/PIL
    copying src/PIL/Image.py -> build/lib.macosx-10.15-x86_64-3.9/PIL
    copying src/PIL/__main__.py -> build/lib.macosx-10.15-x86_64-3.9/PIL
    copying src/PIL/XVThumbImagePlugin.py -> build/lib.macosx-10.15-x86_64-3.9/PIL
    copying src/PIL/SgiImagePlugin.py -> build/lib.macosx-10.15-x86_64-3.9/PIL
    copying src/PIL/ImImagePlugin.py -> build/lib.macosx-10.15-x86_64-3.9/PIL
    copying src/PIL/PsdImagePlugin.py -> build/lib.macosx-10.15-x86_64-3.9/PIL
    copying src/PIL/JpegImagePlugin.py -> build/lib.macosx-10.15-x86_64-3.9/PIL
    copying src/PIL/ImageFont.py -> build/lib.macosx-10.15-x86_64-3.9/PIL
    copying src/PIL/PpmImagePlugin.py -> build/lib.macosx-10.15-x86_64-3.9/PIL
    copying src/PIL/FtexImagePlugin.py -> build/lib.macosx-10.15-x86_64-3.9/PIL
    running egg_info
    writing src/Pillow.egg-info/PKG-INFO
    writing dependency_links to src/Pillow.egg-info/dependency_links.txt
    writing top-level names to src/Pillow.egg-info/top_level.txt
    reading manifest file 'src/Pillow.egg-info/SOURCES.txt'
    reading manifest template 'MANIFEST.in'
    warning: no files found matching '*.c'
    warning: no files found matching '*.h'
    warning: no files found matching '*.sh'
    warning: no previously-included files found matching '.appveyor.yml'
    warning: no previously-included files found matching '.coveragerc'
    warning: no previously-included files found matching '.codecov.yml'
    warning: no previously-included files found matching '.editorconfig'
    warning: no previously-included files found matching '.readthedocs.yml'
    warning: no previously-included files found matching 'azure-pipelines.yml'
    warning: no previously-included files matching '.git*' found anywhere in distribution
    warning: no previously-included files matching '*.pyc' found anywhere in distribution
    warning: no previously-included files matching '*.so' found anywhere in distribution
    no previously-included directories found matching '.azure-pipelines'
    no previously-included directories found matching '.travis'
    adding license file 'LICENSE'
    writing manifest file 'src/Pillow.egg-info/SOURCES.txt'
    running build_ext
    
    
    The headers or library files could not be found for zlib,
    a required dependency when compiling Pillow from source.
    
    Please see the install instructions at:
       https://pillow.readthedocs.io/en/latest/installation.html
    
    Traceback (most recent call last):
      File "/private/var/folders/cr/_2_0z19n6jn54958c_6vc7xm0000gn/T/pip-install-y3h4_a3u/pillow_f118b79644e544f8920affeb1081f4af/setup.py", line 852, in <module>
        setup(
      File "/usr/local/lib/python3.9/site-packages/setuptools/__init__.py", line 159, in setup
        return distutils.core.setup(**attrs)
      File "/usr/local/Cellar/[email protected]/3.9.9/Frameworks/Python.framework/Versions/3.9/lib/python3.9/distutils/core.py", line 148, in setup
        dist.run_commands()
      File "/usr/local/Cellar/[email protected]/3.9.9/Frameworks/Python.framework/Versions/3.9/lib/python3.9/distutils/dist.py", line 966, in run_commands
        self.run_command(cmd)
      File "/usr/local/Cellar/[email protected]/3.9.9/Frameworks/Python.framework/Versions/3.9/lib/python3.9/distutils/dist.py", line 985, in run_command
        cmd_obj.run()
      File "/usr/local/lib/python3.9/site-packages/setuptools/command/install.py", line 68, in run
        return orig.install.run(self)
      File "/usr/local/Cellar/[email protected]/3.9.9/Frameworks/Python.framework/Versions/3.9/lib/python3.9/distutils/command/install.py", line 546, in run
        self.run_command('build')
      File "/usr/local/Cellar/[email protected]/3.9.9/Frameworks/Python.framework/Versions/3.9/lib/python3.9/distutils/cmd.py", line 313, in run_command
        self.distribution.run_command(command)
      File "/usr/local/Cellar/[email protected]/3.9.9/Frameworks/Python.framework/Versions/3.9/lib/python3.9/distutils/dist.py", line 985, in run_command
        cmd_obj.run()
      File "/usr/local/Cellar/[email protected]/3.9.9/Frameworks/Python.framework/Versions/3.9/lib/python3.9/distutils/command/build.py", line 135, in run
        self.run_command(cmd_name)
      File "/usr/local/Cellar/[email protected]/3.9.9/Frameworks/Python.framework/Versions/3.9/lib/python3.9/distutils/cmd.py", line 313, in run_command
        self.distribution.run_command(command)
      File "/usr/local/Cellar/[email protected]/3.9.9/Frameworks/Python.framework/Versions/3.9/lib/python3.9/distutils/dist.py", line 985, in run_command
        cmd_obj.run()
      File "/usr/local/Cellar/[email protected]/3.9.9/Frameworks/Python.framework/Versions/3.9/lib/python3.9/distutils/command/build_ext.py", line 340, in run
        self.build_extensions()
      File "/private/var/folders/cr/_2_0z19n6jn54958c_6vc7xm0000gn/T/pip-install-y3h4_a3u/pillow_f118b79644e544f8920affeb1081f4af/setup.py", line 687, in build_extensions
        raise RequiredDependencyException(f)
    __main__.RequiredDependencyException: zlib
    
    During handling of the above exception, another exception occurred:
    
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/private/var/folders/cr/_2_0z19n6jn54958c_6vc7xm0000gn/T/pip-install-y3h4_a3u/pillow_f118b79644e544f8920affeb1081f4af/setup.py", line 903, in <module>
        raise RequiredDependencyException(msg)
    __main__.RequiredDependencyException:
    
    The headers or library files could not be found for zlib,
    a required dependency when compiling Pillow from source.
    
    Please see the install instructions at:
       https://pillow.readthedocs.io/en/latest/installation.html
    
    
    ----------------------------------------
  Rolling back uninstall of Pillow
  Moving to /usr/local/lib/python3.9/site-packages/PIL/
   from /usr/local/lib/python3.9/site-packages/~IL
  Moving to /usr/local/lib/python3.9/site-packages/Pillow-9.0.0.dist-info/
   from /usr/local/lib/python3.9/site-packages/~illow-9.0.0.dist-info
ERROR: Command errored out with exit status 1: /usr/local/opt/[email protected]/bin/python3.9 -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/cr/_2_0z19n6jn54958c_6vc7xm0000gn/T/pip-install-y3h4_a3u/pillow_f118b79644e544f8920affeb1081f4af/setup.py'"'"'; __file__='"'"'/private/var/folders/cr/_2_0z19n6jn54958c_6vc7xm0000gn/T/pip-install-y3h4_a3u/pillow_f118b79644e544f8920affeb1081f4af/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/var/folders/cr/_2_0z19n6jn54958c_6vc7xm0000gn/T/pip-record-j_6b2nhm/install-record.txt --single-version-externally-managed --compile --install-headers /usr/local/include/python3.9/pillow Check the logs for full command output.

Decrypting a photo of the encrypted image

Suppose we hide some information in an image and print it.
Is this library suitable to retrieve the hidden information from a photo of the printed image captured by a smartphone camera?

I assume printing and taking a picture would distort the lower bit information.
The photo will also contain background and extraneous pixels, which would require finding out the outline of the relevant image.

ERROR: Failed building wheel for pillow

Describe the bug
Cannot install, and get ERROR: Failed building wheel for pillow

To Reproduce
Steps to reproduce the behavior:

  1. Simply running "pip3 install cryptosteganography"

Additional context
Default python installed

  • python 3.9.9
  • python 2.7.18

OS: macOS

need upgrade pillow

image

pillow==9.0 support python3.10

image

ERROR: stegano 0.9.9 has requirement crayons<0.5.0,>=0.4.0, but you'll have crayons 0.3.0 which is incompatible.
ERROR: stegano 0.9.9 has requirement pillow<9.0.0,>=8.2.0, but you'll have pillow 6.2.2 which is incompatible.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.