It seems to work fine from the point of view of encryption/decryption but it also has a weird issue. When I use cape.decrypt() my electron will not publish for some reason. if I remove that line it works no problem.
Does anyone have any idea what the issue might be?
maybe provide some more detail on how you are building the buffers, but these two arrays suggest you may not be properly NULL terminating decrypted, since it doesn't provide enough space for the maximum size of any of the 20 RX_DATA buffers...