My idea is probably unnecessarily complicated, but for sending an encrypted message you could set up a flask WSGI HTTP server that receives input via the URL, create a script that forwards that to HTTPS server (self signed certificate is technically more vulnerable), and if this is for production, you could make the HTTPS port UPnP so it forwards automatically. Assuming all of the scripts getting forwarded listen at whatever your system perceives itself to be (not 0.0.0.0), this should make some fairly secure communication.