CAN Bus Security Analysis and Intrusion Detection
Bit-level multi-signal packing and rate-based anomaly detection on a simulated ECU network
01Problem
CAN has been the standard bus between vehicle ECUs since 1986, and it carries no sender authentication. Any node with bus access can transmit any identifier, and every node receives every frame, which is the structural reason spoofing, sniffing, and message injection all work. Our six-person team analysed the data frame field by field and rebuilt a working transmitter, receiver, monitor, and intrusion detector in LabVIEW. Instead of conventional ECU signals we packed six human biometric signals into the payload, which made the bit-packing design something we had to derive rather than copy.
02What I built
- A 64-bit signal map for six signals — LFT 10, HEM 19, BRAIN 21, WATER 3, GENDER 1, STRESS 10 bits — that fills the data field exactly, with no overlap and no unused bits.
- Symmetric transmit and receive bit packing in LabVIEW Formula Nodes using AND, OR, and shift, verified byte by byte against hand-computed patterns.
- A rate-based intrusion detector: the receive loop measures the actual packet interval, switches the hazard LED to red when it exceeds the configured rate, and stops the loop in the same cycle.
03How it works
The demonstrator is a single LabVIEW VI with two loops. The transmit loop takes six signal values, packs them into byte0 through byte7 in a Formula Node, and joins them into a uint8[8] array that stands for the data field of a frame with identifier 5 and DLC 8. The receive loop indexes that array, runs the inverse bit operations, drives the monitoring gauges, and feeds the rate monitor that decides whether traffic looks injected.
04Results
05Engineering decisions
- Pack six signals into one frame rather than sending one frame per signal. The data field is fixed at 8 bytes, so six separate frames would carry the same information at six times the bus load.
- Detect intrusion by packet rate rather than by payload content. CAN offers no sender authentication, so timing is the only signal available without changing the protocol — and the cost is real: a forged frame sent at the normal rate is invisible to this detector.
- Carry fractional and negative values with a x100 scale and a +100 offset instead of widening the fields. Two's complement would consume the whole 10-bit STRESS field, while a shared offset costs no bits at all; the price is that everything below the second decimal is lost.