On 13/02/15 19:21, Hannu Vuolasaho wrote: > Hello! > > I'm working with radio link and in fear of enemy commands I would like to > make some kind of data authentication. > > However my limited understanding says I need encryption and decryption for > key exchange, while normal hash function would suffice other cases. > > Has anyone seen, done or used anything useful?
I don't know about encryption packages available off-the-shelf in amforth, but I can give you some tips on encryption. If you control the devices at all ends of the radio link, so you can pre-program the same key into all of them, there's no need to worry about key exchange. To prevent forging of messages, you can do something like adding a hash to the messages - but hash the message AND a secret at the sender. The recipient takes the message, hashes it AND the same secret, and checks to see if the resulting hash is the same. A good hash function implementation will let you feed two strings into the same hash computation, making this easy. If your radio protocol can't spare the bits for a full SHA-512, then do the SHA-512 but only send 64 bits or so, as much as you can spare. Work out how hard it would be for an attacker to try all possible hashes until one works, and given your link bandwidth, how long that would take them, and be sure you're happy with that. If your app can't spare the CPU cycles and RAM and ROM for such a hairy hash as an SHA-512, then you'll need to choose a hash you can afford - it's hard to suggest one without knowing your constraints :-) ABS -- Alaric Snell-Pym http://www.snell-pym.org.uk/alaric/ ------------------------------------------------------------------------------ Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server from Actuate! Instantly Supercharge Your Business Reports and Dashboards with Interactivity, Sharing, Native Excel Exports, App Integration & more Get technology previously reserved for billion-dollar corporations, FREE http://pubads.g.doubleclick.net/gampad/clk?id=190641631&iu=/4140/ostg.clktrk _______________________________________________ Amforth-devel mailing list for http://amforth.sf.net/ Amforth-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/amforth-devel