Skip to main content

Protect unintended copy of your images by hiding the key in plain sight

Project description

GetScrambled python


Description

GetScrambled is a simple library that allows you to scramble a image. No key is needed to unscramble the image, because the key is stored in the image itself (steganography and least significant bit). The image is scrambled by shuffling blocks of pixels. The size of the blocks can be set by the user.

The library uses pillow for image manipulation.

Example

from getscrambled.encode import encode
from PIL import Image

# Encode
image = Image.open("tests/data/baboon.png")
scrambled_image = encode(image, block_size=16)
scrambled_image.save("tests/artifacts/baboon_scrambled.png")

# Decode
from getscrambled.decode import decode
decoded_image = decode(scrambled_image)
decoded_image.save("tests/artifacts/baboon_decoded.png")

Original and scrambled image

![baboon](tests/data/baboon.png| width=100) ![baboon_scrambled](tests/artifacts/baboon_scrambled.png| width=100)

Installation

pip install getscrambled

Development and testing

git clone https://github.com/Starmania/getscrambled
cd getscrambled
poetry install
poetry run pytest

Disclaimer warning

This library is not meant to be used for security purposes nor to encrypt data. It will just make harder to see the original image. You could check that I never use the word "encrypt" in this repository.

Todo

  • More tests

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

getscrambled-1.0.0.tar.gz (8.1 kB view hashes)

Uploaded Source

Built Distribution

getscrambled-1.0.0-py3-none-any.whl (10.1 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page