Electrical – I2C design with secure message

i2c

Is it possible to secure I2C communication between slave and master so nobody else can connect their devices to the master. Basically encrypting the message.

Is this feasible by software or hardware?

Note: I have a sensor that connects to ADC(there are amplifier and filter before this) which I communicate with I2C to read the sensor data. I would like to make sure nobody can use my sensor without my controller.

Base on everyone feedback I will try to use a microcontroller with precision ADC to send data. but does anybody know a small and cheap microcontroller that has precision ADC with I2C port?

enter image description here

Best Answer

Since you probably won't find an ADC with built-in encryption, your best bet is to use a microcontroller (MCU) that includes an ADC, and encrypt (or at least obscure) its output data. (This seems to be what you are saying in your edited question, but the diagram you provided still shows a separate ADC.)

You need to specify what you mean by "precision". While many MCUs contain ADCs, ADCs built in to MCUs usually aren't "precision" compared to stand-alone devices.

If all you want is to make it difficult for someone to reverse-engineer your system, you don't need state of the art cryptography. A fairly simple scheme to obscure a data stream is to generate a pseudorandom sequence with an LFSR, and XOR your data with the sequence. This will increase the cost of reverse-engineering your data stream.

Make your LFSR long enough (32 bit) and perhaps don't choose the one maximal-length sequence, choose one of many less than maximal length ones.

You will need to figure out how to synchronize your receiver's sequence with your transmitter's, or what to do if they become desynchronized.