mirror of
https://gitlab.kit.edu/kit/scc/sys/mail/exim-encrypt-dlfunc.git
synced 2025-12-06 12:03:55 +01:00
20 lines
350 B
Python
Executable File
20 lines
350 B
Python
Executable File
#!/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)
|