diff options
| author | Louis Burda <quent.burda@gmail.com> | 2025-01-17 23:45:10 +0100 |
|---|---|---|
| committer | Louis Burda <quent.burda@gmail.com> | 2025-01-17 23:45:10 +0100 |
| commit | cf5fa862dd80bc1fb5faa525aa6873c5e755dbe8 (patch) | |
| tree | db7a3e6a5bf0b3a4eca1b35fe7f0c3244a6690c2 /meta/encrypt.py | |
| download | nullcon2023-bmpass-master.tar.gz nullcon2023-bmpass-master.zip | |
Diffstat (limited to 'meta/encrypt.py')
| -rw-r--r-- | meta/encrypt.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/meta/encrypt.py b/meta/encrypt.py new file mode 100644 index 0000000..5451f4a --- /dev/null +++ b/meta/encrypt.py @@ -0,0 +1,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) |
