I need to encrypt transmission between my device (with AVR processor) and base. I create packet data - it will be encrypted into string:
PacketData {
int packetN;
string data;
CRC16 checksum;
string nextKey;
}
As you can see, key will be changing after each packet.
First, I tried to use XOR
encryption, but I forgot that if attacker know plaintext, all encryption will be without sense.
Now, I have an idea - first, use RC4 on data with key, and XOR result with same key. I see bad side of this solution - key will be same for both operations, and I want key length ~64 bits. Handshake will be written on device (8 characters), and connection will be made when base sends encrypted packet with handshake. Also, data size will be usually between 4 and 32 bytes, sometimes more.
Is this encryption give me sufficient safety? After reading about RC4 in WPA, I see that is problem in WPA implementation. Maybe I should use (when connected) two keys, for RC4 and XOR, both sended in encrypted packet?
Please, tell me what do you think about it. It must be light solution (because tiny processor) so I can't use AES. My solution is right?