Cyber-physical systems (CPSs) consist of networks of sensors, computers and actuators. This research studies a control system within a CPS in which the plant and controller are separated geographically but connected through communication links. The links could be subject to security attacks. Recently, the research focus on attack detection has been growing rapidly. This thesis aims to develop methods based on the dynamic models of CPS for detecting attacks. This research focuses on detection of ”replay attacks”. First, it proposes a watermarking scheme based on injecting a sequence of multi-sine waves. The watermarking is designed in such a way that the transient response to watermarking is suppressed. A design process is proposed to reach a compromise between (i) the ease of detection of watermarking effects in the output and (ii) the limiting of output fluctuations due to watermarking (and loss of control quality). One of the benefits of this method is that it only requires frequency response of the closed loop system at a set of frequencies; a model of system is not required. Power spectral density estimates based on periodograms of the plant output (received by the controller) are used to trace watermarking. Furthermore, replay attack detection by tracing watermarking effects in the residual of Kalman filters is also explored. A case study involving a laboratory water tank is used to explore the proposed method. The results of linear and non-linear model simulations are presented and is shown that replay attacks can be detected successfully.