  The replay attack detection problem is studied from a new perspective based
on parity space method in this paper. The proposed detection methods have the
ability to distinguish system fault and replay attack, handle both input and
output data replay, maintain certain control performance, and can be
implemented conveniently and efficiently. First, the replay attack effect on
the residual is derived and analyzed. The residual change induced by replay
attack is characterized explicitly and the detection performance analysis based
on two different test statistics are given. Second, based on the replay attack
effect characterization, targeted passive and active design for detection
performance enhancement are proposed. Regarding the passive design, four
optimization schemes regarding different cost functions are proposed with
optimal parity matrix solutions, and the unified solution to the passive
optimization schemes is obtained; the active design is enabled by a marginally
stable filter so as to enlarge the replay attack effect on the residual for
detection. Simulations and comparison studies are given to show the
effectiveness of the proposed methods.
