Created
April 3, 2021 00:31
-
-
Save symisc/b54babbc94309b183e672f8e77799d74 to your computer and use it in GitHub Desktop.
Encrypt an Image to Enciphered Pixels using the PixLab API - https://pixlab.io/cmd?id=encrypt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
import json | |
# Converts plain pixels of a given image to enciphered pixels. The image is not readable until it has been deciphered using decrypt. | |
# https://pixlab.io/cmd?id=encrypt && https://pixlab.io/cmd?id=decrypt | |
# Target image to enrypt | |
img = 'https://pixlab.io/images/bencrypt.png' | |
# Password used for decryption | |
pwd = 'superpass' | |
req = requests.get('https://api.pixlab.io/encrypt',params={'img':img,'pwd':pwd,'key':'PIXLAB_API_KEY'}) | |
reply = req.json() | |
if reply['status'] != 200: | |
print (reply['error']) | |
else: | |
print ("Link to the encrypted picture: "+ reply['ssl_link']) | |
# Call https://api.pixlab.io/decrypt with your passphrase to make it readable again |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment