In my own automation system I have to encrypt data transferred between sensor and main controller (data transfers via twisted pair).
For this reason, I need a special devices - encryption gateways (one gateaway installs on sensor-side, another on controller-side). These gateways realize following algorithm:
Receive some data from sensor (via discrete input);
Encrypt data using AES;
Transfer encrypted data to controller-side gateway.
Receive encrypted data from sensor-side gateway;