Erik Reikes wrote: >Does anyone know of private key encryption that would be suitable for use >in a PIC uC for encrypting small byte stream messages? > >It doesn't have to withstand detailed cryptanalysis, but the harder to >break, the better. I had initially thought of just having a rotating 16 >bit key that is xored with each byte. This seems like it might be pretty >easy to crack though. I really have no experience with this sort of thing. > >We're not transmitting credit card numbers or anything, we just want to >obscure our underlying protocol for marketing purposes. > >Any pointers? I have a simple serial data multiplexer/router here: http://kdsl32.dnvr.uswest.net/cgi-bin/tl.exe/Timemon/sermux/sermux_m.asm It scrambles the body of packets so that packets from cascaded multiplexers are not visible until extracted and thus cannot be mistaken for packets from the parent multiplexer. It accomplishes the scrambling by xoring each byte of the data stream with a special kind of CRC-like value (which I called a "cyclic checksum" in the comments). This CRC has the property that it is a very good pseudorandom number generator whether or not the input datastream has any complexity (i.e. the input data stream can be a stream of all zeros and the CRC will still be a pseudorandom sequence). The version used in my multiplexer only calculates a 16-bit value .. thus the sequence will repeat after 65536 iterations when applied to a monotonous input data stream. Non-monotonous data alters the sequence. A good crypto expert may not find it too difficult to crack this code if any features of the original (unencrypted) data are known. If your original data is completely unknown or you make a longer (i.e. 32-bit or 64-bit) variation of the CRC-like algorithm then I would expect it to keep a good crypto expert busy for quite a while (but then again I don't know much about cryptanalysis so maybe there is some technique for solving such codes that I'm overlooking). Anyway ... maybe this will give some ideas. Good luck, Ken