Hi there, I am working with the automation of my home based on
PJON, that is a communication protocol like i2c or 1wire I wrote it in years of trial and error. It let communicate more then 10 arduino boards (supports 255) over a single wire that goes all around the house inside the walls. In any case, some time ago I found an article speaking about the capabilities of consumer products with a volume of a briefcase able to get digital data inside a wire, inside a wall, wirelessly quite far like 20 meters. For this reason to feel safer, I decided to add encryption feature to PJON and I went up writing the Cape library:
https://github.com/gioblu/Cape(Obviously I am partially joking and I only wanted to dig further in cryptography and learn something new)
Cape can encrypt strings of maximum 100 characters (hardcoded in Cape.h) with an algorithm inspired by the RC4 standard with the addition of 1 byte initialization vector and tunable encryption_strength; all this is reversible, so two entities with the same key can share encrypted data and come back to original content without any other procedure (RC4 like part). Without initialization_vector, crypting the string multiple times will give you always the same encrypted result, that is generally considered as really not exactly the most secure crypted communication. Using initialization vector a pseudo random byte is added to the string, and is used after the RC4 like procedure to further fuzz the information you are sharing. In this case you will have 254 hashed versions of the same string, and for a possible listener would be really difficult to collect data about the system
The library let you choose if you want the initialization vector or not.
I hope this could be useful for your projects and to higher your privacy!!
I hope also to get some feedback from the community and maybe some critics / suggestion and hopefully testing!!
Good nerding!