From 247e756cd615d146d44fc98ce0f19581adb9db4d Mon Sep 17 00:00:00 2001 From: Abderrahmane Smimite Date: Mon, 1 Jul 2019 00:33:30 +0200 Subject: [PATCH] Output as json --- app.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app.py b/app.py index a655c9a..4268971 100644 --- a/app.py +++ b/app.py @@ -57,7 +57,8 @@ def encrypt(): except: abort(403) - return encrypted + return json.dumps({'ciphertext':encrypted.decode()}) + @app.route("/decrypt", methods=['POST']) def decrypt(): @@ -82,7 +83,7 @@ def decrypt(): except: abort(403) - return decrypted + return json.dumps({'plaintext':decrypted.decode()}) if __name__ == "__main__": app.run(host='0.0.0.0', port=5000) \ No newline at end of file