A method for detecting a connection of an unauthorized electronic device to an electrical interface of a vehicle, the electrical interface for connecting a plurality of control electronic devices to the vehicle, the plurality of control electronic devices for providing control to the vehicle, the method being executable by a measuring device communicatively coupled to the vehicle via the electrical interface, the method comprising:
- at a first moment in time, determining, by the measuring device, a first value of a total electrical impedance of the electrical interface, the determining the first value of the total electrical impedance of the electrical interface being based on internal impedance values associated with the plurality of control electronic devices connected thereto, wherein for each one of the plurality of control electronic devices, a respective internal impedance value has been predetermined;
- at a second moment in time after the first moment in time, determining, by the measuring device, a second value of the total electrical impedance of the electrical interface, the determining the second value of the total electrical impedance of the electrical interface being based on internal impedance values associated with each electronic device connected thereto;
- in response to the second value of the total electrical impedance being different from the first value of the total electrical impedance, determining that the unauthorized electronic device is being connected to the electrical interface of the vehicle.