LowPowerLab Forum

Hardware support => Moteino => Topic started by: dzairo on April 06, 2020, 06:23:01 AM

Title: RFM69 library ...security , sendWithRetry ..
Post by: dzairo on April 06, 2020, 06:23:01 AM
Hi all.
I'm new on this forum and on RFM69 .. then pls. understand me.
I have two question .
1.  send data from Sender to Receiver I use radio.sendWithRetry(GATEWAYID, buff, sendSize,10,0)
If Sender do not receive ACK then repeat and send it again .. 10 times ..
it's OK . But how Receiver know that Sender don't received my ACK , and actually received data are not new data , data are same but  repeated from same Sender because don't received ACK..

My idea is to meke changes in code . Count how many times need repeat frame while not received ACK and send it with packet.Then to packet add random number (1 byte or 2 byte) . This random number define transaction . Then total size for payload will be 58 bytes .
Receiver receive packet. Store to memory (not need for all node,for last 10 or 20 only )random number , and check if packet is first or repeated, compare random number, if equal that mean Sender don't received ACK and try send packet again.. We need count how many : Sender will see so there is problem , Receiver is also see problem with this Sender .

2.question about security .
   if we want protect communication we can do few option , I write to option..
    A. encrypt data
    B. sign data

A.module RFM69HCW have AES-128bit  . very good .. but if nothing change in packet (RSSI , payload etc..) after AES encryption result data are same !!!!
If want do it better then must change minimum 1 bit on packet.. For this we need change packet with random number (2byt is ideal).
But .. (I'm not a conspirator) AES key is not possible save to internal write only memory . If want use AES then every time if reset MCU or module RFM69 need write this key to RFM69 again.
and this is door to attack my communication .. (read SPI communication) , Then my idea is better to use software encryption , and don't need AES .. For example XXTEA and other.

B. sign data , all see what I send , but if data are signed then know , data are original . But for this is problem because lost many space form payload.

on MySensor project use external encryption chip ATSHA204 , have protected memory to store key or other important information.
I prefer easy software encryption if security need .. what is your idea??
Title: Re: RFM69 library ...security , sendWithRetry ..
Post by: dzairo on April 06, 2020, 06:51:49 AM
hehe ..  ;D

few post lower .. is this same question : https://lowpowerlab.com/forum/moteino/sendwithretry()-missed-acks/

also good idea ..