summaryrefslogtreecommitdiffstats
path: root/meta/encrypt.py
blob: 5451f4add3e92902e0f506d468d43cabd49a67f6 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
#!/usr/bin/env python3

from Crypto.Cipher import AES
import os, sys

img_in = open(sys.argv[1], "rb").read()
img_in += b'\00' * (16 - (len(img_in) % 16))
cipher = AES.new(os.urandom(16), AES.MODE_ECB)
img_out = cipher.encrypt(img_in)
open(sys.argv[1] + ".enc", "wb+").write(img_out)