Saturday, May 12, 2018

Circular CAN IDs list with dynamic compression

Circular CAN IDs list with dynamic compression and CAN context dynamic changing
of IDs -> Cyber Security: Suppression of CAN messages

- use CAN & CAN FD
- use r0,r1/res reserved bits from Control Field
- use a simple arithmetic compression algorithm (better than RLE based on Calkin
Wilf tree)
- ECU with freeze frame data buffers which will store the IDs of an ECU which leave
or enter the communication
- security mechanism guaranteed by the fact that IDs are changed dynamic with the
context of the bus

Implies changes only the SW CAN task.

Compress only messages with a very long sequence of bits with the same value (ie
64 bits of 0 will be compressed by using the value of the fraction obtained visiting the Calkin-Wilf tree so 1/63; 1/63 will be stored using 7 bits for 1 and 7 bits for 63 -
so 14 instead 64).
Such messages will have the CAN ControlField reserved bits set at the beginning
with a fixed value which can be in time also changed via a known swapping values
mechanism.
Also the layout of bits inside such message can be circular shifted with the same
value.
63 will mean that after a sequence of 63 messages which can be again compressed
each ECU will swap using a circular mechanism the IDs for their messages.
All ECU will have the arbitration phase done more complex - each ECU will know the
real ID but using an array will store the new values.
At the begging of communication the values like 63 will be very frequent because
most of delault/init values from DBCs are with min/max values.
I.e. Motor message will have at the beginning in the DBC the CAN ID 0x10.
After 63 messages that can be compressed each ECU so also the Motor ECU will
circular shift all values of IDs with 1 position (or 63 positions).
Instead of sending the value 0x10 the Motor ECU will send it's message with a new
ID - eg 0x0F or 0x11 it depends on the direction chosen to be used for circular
shifting.
The value 63 will be used like a new XOR mask with all the bytes from each message
also CRC bits also stuffing bits, till a new value will be determined from a message
that can be again compressed.
When an ECU wants go PowerReducion it will just stop communication at the CAN
level transmission.
When an ECU want to restore from PowerReduction in the CAN communication will
send a special message with initial ID from DBC and last known ID known after last
circular shift of IDs for 2/3 times.
At this moment all ECU will receive this message and will re-init the process with
last known values of IDs -> IDs shifted with the last number of compression done,
known by the ECU that wants to re-enter into the communication.
The compression mechanism will allow each ECU to have time for something else
and the remaining bits can be filled with random values.
In this way the message i.e. 0x10 will be very difficult to be falsified and an
injected 0x10 message will not be interpreted like a valid ID due to the changed ID
arbitration mechanism.

Assures dynamic security - IDs changed dynamically also XOR datas using the
context from the bus.
Can be applied directly from the moment when a new battery is installed in a car and
this process will start with the ECUs which does not have relation with Klemme_15 -
key position.

CAN task and arbitration should be changed - in order to be done on the idexes
of the messages array and not using the values stored there - but sending these
values.
Using circular lists of IDs the values can be mathematical determined and not
necessary searched inside this array.

No comments:

Post a Comment