Cape.h preventing publish

Hey Everyone! I am trying to us some basic encryption on the particle electron.
I am using Cape.h from here:> https://github.com/gioblu/Cape/blob/master/README.md

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?

Thanks!

Could you show us your full code to save us from guessing? Preferably share it from within the Web IDE.

1 Like

Hey,
so I have 2 character arrays,

char decrypted[69];
char RX_DATA[20][70];

I am placing the decrypted version of RX_DATA into decrypted using:

cape.decrypt(RX_DATA[j], decrypted, sizeof RX_DATA[j]);

It seems to work ok but for some reason my electron wont publish when I call cape.decrypt…

char decrypted[69];
char RX_DATA[20][70];

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…

1 Like