6

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!!

| improve this question | | | | |
  • 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 Dec 10 '19 at 1:21
  • @anonymous2 this ended up being exactly what I need! Thank you! – Tuomas Talvitie Dec 28 '19 at 19:09
4

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!

| improve this answer | | | | |
  • Thank you! This made everything possible! – Tuomas Talvitie Dec 28 '19 at 19:10
  • @TuomasTalvitie Glad I was able to help! – Darius Chira Dec 28 '19 at 19:12
2

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.

| improve this answer | | | | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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