Skip to content

Instantly share code, notes, and snippets.

@symisc
Created April 3, 2021 00:31
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save symisc/b54babbc94309b183e672f8e77799d74 to your computer and use it in GitHub Desktop.
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
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