I need to send short RF messages (approx: 2 bytes) between 8051 devices. How do I make sure that the messages are not tampered and that the message really came from the device?
I was thinking of using CMAC AES. But found out that AES isn't efficient on 8051.
Regardless of the CPU, you are looking at "message authentication" (aka "signing"). It's usually done by taking some cryptographic function of the message, & sending that along with it. The first thing you need to determine is, what level of threat do you face? A bored student filling in a rainy night, or a major government agency which *really* wants to hack your system? A large spectrum in between. Where you are on it, determines how much security (read, CPU cycles) you need to provide.
If you only have two bytes of bandwidth, your attacker only has to try
65536 messages and he's in, even if you have the most robust cryptosystem known to man.
An application like this would possibly work well with a rolling-code algorithm like Microchip's Keeloq (note that it is patented, and you can't field this commercially unless you either use a Microchip part, or license the algorithm).
In which case there are other methods and they have the resources to try other methods from "interviewing" you to a small air strike :-). So the crypto becomes pointless
You probably don't need AES. Just enough to be a bit more difficult that it is worth or making it a bit harder than alternative possible attacks.
It comes back down to the threat level.
--
\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
\/\/\/\/\ Chris Hills Staffs England /\/\/\/\/
What distance are all of the 8051 devices from each other?
Maybe you could get away with using really low power. Any hacker would have to get within a few metres to receive your RF messages. If they are stuck outside a building in a car then they simply wouldn't be able to receive your RF messages.
Obscure your RF messages in a sea of noise. Transmit more than just 2 bytes at a time, say, 64. Make the other bogus bytes look like they might actually be something when they aren't. Eg. add in a few valid checksums.
Send more transmissions than are necessary. Not every transmission actually has to mean something.
Lead your hacker up many blind alleys
The only sure way is this:
formatting link
Although I guess it will take a while for this technology to "trickle down" ;)
An algorithm is a recipe and you cannot patent recipes (in Europe). You can patent a means of implementing one, like a chip, but not the recipe itself. Do you have a pointer to the Microchip patent?
How fast do you need it to be? If you write the code in assembler you can do AES encryption in about 1ms on an 8051 (I'd have to find my old notes to check what speed part that was, but it wasn't anything fancy, just a Phillips LPC of some sort).
ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here.
All logos and trade names are the property of their respective owners.