mirror of
https://gitlab.kit.edu/kit/scc/sys/mail/exim-encrypt-dlfunc.git
synced 2025-12-06 08:43:55 +01:00
Added proof-of-concept decoder in Python 3
This commit is contained in:
19
src/decode.py
Executable file
19
src/decode.py
Executable file
@ -0,0 +1,19 @@
|
|||||||
|
#!/usr/bin/env python3
|
||||||
|
|
||||||
|
import pysodium
|
||||||
|
import base64
|
||||||
|
import sys
|
||||||
|
|
||||||
|
assert(len(sys.argv) > 1)
|
||||||
|
|
||||||
|
input = sys.argv[1]
|
||||||
|
ciphertext = base64.b64decode(input)
|
||||||
|
|
||||||
|
with open('./recipient_sk.raw', 'rb') as f:
|
||||||
|
sk = f.read()
|
||||||
|
|
||||||
|
with open('./recipient_pk.raw', 'rb') as f:
|
||||||
|
pk = f.read()
|
||||||
|
|
||||||
|
cleartext = pysodium.crypto_box_seal_open(ciphertext, pk, sk)
|
||||||
|
print(cleartext)
|
||||||
Reference in New Issue
Block a user