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

Ola Ström
  • 133
  • 1
  • 1
  • 6
Tuomas Talvitie
  • 233
  • 1
  • 4

2 Answers2

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!

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.

ThisaruG
  • 824
  • 6
  • 16