Coding Sensor Outputs for Injection Attacks Detection