项目作者: user163

项目描述 :
Encryption / Decryption of images with AES-CBC/ECB
高级语言: Python
项目地址: git://github.com/user163/image-encryption.git
创建时间: 2020-12-28T15:46:47Z
项目社区:https://github.com/user163/image-encryption

开源协议:MIT License

下载


image-encryption

Encryption / decryption of images with AES in Python 3 (CBC and ECB mode supported)

Dependencies

Configuration

The following settings are possible in PyImgEnc.py:

  • Set the mode in section ‘# Set mode’: AES.MODE_CBC or AES.MODE_ECB.

  • Set the file path of the image to be encrypted in section ‘# Load original image’: If the image is in the same directory as PyImgEnc.py, only the filename is required, e.g. topsecret.jpg.

Image formats

  • The images to be encrypted can be in one of the common formats (jpg, bmp, etc.).

  • Encrypted images can also be saved. For this purpose a lossless format like bmp must be used.

Program execution and flow

  • Start the program under Windows in the comand prompt with: py pyimgenc.py

  • Once the program is started, the original image is displayed first. A click on any key displays the encrypted image. A further click displays the decrypted image. Another click deletes all images and exits the program.

Example

Original image

Alt text

Encrypted image (CBC mode)

Alt text

Encrypted image (ECB mode)

Alt text

Decrypted image

Alt text