Added proof-of-concept decoder in Python 3

This commit is contained in:
Heiko Reese
2021-08-11 01:58:07 +02:00
parent 72549d0649
commit f5727effcf

19
src/decode.py Executable file
View 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)