我想问你,你有没有用 javascript 或 node js 为 LORA IOT 传感器编码 AES-128 加密或解密?我在 HEX 中有一个有效载荷(加密)和 kay 值对。您能帮我对有效载荷使用哪种方法来获得原始有效载荷吗?
2 回答
Since the data is encrypted, suppose that you are using LoRaWAN.
First of all, we should know which type of the packet is. Is it an uplink message or a downlink message? You may refer to the LoRaWAN specification to figure out the message type.
Secondly, you may move ahead to understand how MAC frame payload is encrypted/decrypted. The section.4 in the specification can help you.
Thirdly, if you want to implement the encryption/decryption in , maybe this pure node.js repo can help you: anthonykirby/lora-packet. Please pay attention to the LoRaWAN packet structure, there payload(data) is only part of the whole packet. You may filter the data first, and then do decryption. Hope this could solve your problem.
您使用的是 LoRa 还是 LoRaWAN?
我想你可能正在使用 LoRaWAN。如果是这样,您可以查看TTN 的 github作为参考,或者只使用 TTN 作为您的网关。