I am sending sensor data between two Raspberry Pis via lora. I am using two Lora Radios and NOT using a LoraWan network like The Things Network. How should I encrypt my data? Are there any open source python libraries?

Thank you!!

  • 3
    Would cryptography do the job? I'm no expert in the field, but seems to me that if you're using your own networking protocols, just about any encryption library ought to work, and cryptography's the only one I've actually used (albeit a while ago).
    – anonymous2
    Commented Dec 10, 2019 at 1:21

2 Answers 2


Well if it's your devices and network, it's going to be way easier then usual, you can just use a symmetric key encryption like AES and hard code the key in both devices.

To do this, I would recommend cryptography.io and you could use the Fernet method

from cryptography.fernet import Fernet

From there on, if you go to their website, it should be quite straight forward how to implement it. You generate a key, save it on both devices, use it before you send a message and after you receive one to encrypt and decrypt.

Hope this helps, good luck!


I'd like you to suggest Ballerina for this. Ballerina is a new programming language designed specifically for network applications. It has in-built Crypto and Auth library, which you can easily use for encryption.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.