Page
13
of
32
©
2019 Radiocrafts AS
RC232 User Manual (ver 2.01)
RC232 USER MANUAL
5 Encryption and decryption (RC17xxHP only)
The RC232 protocol can encrypt data before transmission, and decrypt at reception. The CRC is used to verify
correct decryption, so the 2 byte CRC (CRC_MODE = 2) should be enabled when using encryption. Also, both the
ENCRYPT_FLAG and DECRYPT_FLAG must be set for a successful link.
The encryption method used is AES-128-CTR mode. Using the counter mode means that any packet length can be
encrypted without the use of filler bytes. Both the Initialization Vector (Initial Counter Block) and the Encryption Key
are fixed. AES uses a symmetric key. That is, the same Encryption Key is used for both encryption and decryption.
Also the Initialization Vector must be the same. These are stored as INIT_VECTOR and DEFAULT_KEY, both 16
bytes long.
5.1 Enabling Encryption and decryption
You need to set both ENCRYPT_FLAG and DECRYPT_FLAG to have a successfull link.