  The problem of detecting replay attack to the linear stochastic system with
Kalman filer state estimator and LQG controller is addressed. To this end, a
dynamic attack detector method is proposed which is coupled with the dynamics
of the system. While preserving stability of the main system, conditions on
parameters of the attack detector dynamics are obtained such that the attack
can be revealed by destabilization of a residual trajectory which is the
difference between the estimated and measured output of the system. Using this
method, system operator can adjust the detection rate based on the proposed
scheme by changing the design parameters. Nevertheless, since the exogenous
attack detector signal affects the performance of the closed loop control
system, we propose an optimization problem to determine such a detector with
minimum loss effect. In the simulation results, the proposed dynamical attack
detector approach is compared with the well-known additive white noise
watermarking method and the results confirm the superiority of the new scheme.
