image encryption cli tool, supports the following operations
AES encrytion/decryption
Encryption/decryption using Arnold's cat map
Encryption/decryption using one time pad
LSB steganography
Recommended to set up a venv first
pip install -r requirements.txt
usage: python imcrypt.py [-h] --image IMAGE [--message MESSAGE] [--key KEY] [--password PASSWORD] MODE
MODE can be any one of these {1time_pad_en,1time_pad_de,arnold_cat,arnold_cat_de,aes_en,aes_de,stegsno_write,stegano_read}
-- image. -i image to encrypted
-- messsage, -m message to be hidden in image(for steganography mode)
-- key, -k address of key image for one time pad or number of iterations for Arnold's cat map
-- password, -p password for aes mode
1time_pad_en,1time_pad_de - Generates a randomly generated key and performs xor with the orginal image to create encrypted image, the key and the encrypted image both are required for decryption
arnold_cat,arnold_cat_de - a chaotic map that maps a pixel at (x,y) to (2x+y,x+y)mod n the current implementation work only for square images, any rectangular image will be padded as a square.
stegsno_write,stegano_read - Implementation of LSB-steganography.
aes_en,aes_de - standard AES implementation
python imcrypt.py arnold_cat --image Arnold_cat.png -k 37
python imcrypt.py arnold_cat_de --image Arnold_cat.png -k 37
python imcrypt.py 1time_pad_en --image amg.png
python imcrypt.py 1time_pad_de -i amg.png -k key-amg.png
python imcrypt.py aes_en -i lab.png -p "woof woof"
python imcrypt.py aes_de -i lab.png -p "woof woof"
python imcrypt.py stegano_write -i car.png -m "Hello everyone !!"
Image with message encoded.
python imcrypt.py stegano_read -i car.png
> Hello everyone !!
- Download any image and try decrypted them to see the result *
for other apps that may use image encryption but don't want to use CLI the engine class provides an easy interface to do so. Where methods of i/o may be different. Eg flask backend, tkinter GUI
engine = Engine()
engine.setImgRead(read_image).setImgWrite(save_img).setLogger(loggingFun)
engine.loadStratergy(stratergy).exe(operation,**kwargs)
Here stratergy can be
- ArnoldCat,
- OneTimePad,
- AES
- Stegano
operation can be
- encrypt
- decrypt