Modifications

Sauter à la navigation Sauter à la recherche
292 octets ajoutés ,  27 février 2022 à 22:53
Ligne 79 : Ligne 79 :  
The module encrypts the data with AES-128.
 
The module encrypts the data with AES-128.
   −
The encryption key is defined into the following lines.
+
The encryption key is defined with 16 bytes and assigned to the {{fname|encryption_key}} property.
   −
<syntaxhighlight lang="c">// The encryption key has to be the same as the one in the server
+
The code here below defines the key {{fname|1234567812345678}} under binary format.
uint8_t key[] = { 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08,
+
 
                  0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08};
+
<syntaxhighlight lang="python">...
rf69.setEncryptionKey(key);</syntaxhighlight>
+
rfm = RFM69( spi=spi, nss=nss, reset=rst )
 +
rfm.encryption_key = (  b"\x01\x02\x03\x04\x05\x06\x07\x08\x01\x02\x03\x04\x05\x06\x07\x08" )</syntaxhighlight>
 +
 
 +
It is also possible to defines the same key with a more user friendly code.
 +
 
 +
<syntaxhighlight lang="python">...
 +
rfm = RFM69( spi=spi, nss=nss, reset=rst )
 +
rfm.encryption_key = bytes( [1,2,3,4,5,6,7,8,1,2,3,4,5,6,7,8] )</syntaxhighlight>
 +
    
{{ambox-stop|text=It is highly recommended for each team to define its own encryption key.}}
 
{{ambox-stop|text=It is highly recommended for each team to define its own encryption key.}}
   −
'''When all the teams do use the same frequency and the same key''' then they will all receives the messages from the other teams sending messages. Your messages will also been received by all the other teams.
+
'''When all the teams do use the same frequency and the same key''' then they will all receives the messages from the other teams also sending messages. Your messages will also been received by all the other teams.
    
=== Transmission Power ===
 
=== Transmission Power ===
29 918

modifications

Menu de navigation