Ensuring cyber security of smart grid based on supervisory control and data acquisition using information and communications technology has been becoming a major challenge. Especially, a replay attack is a dangerous cyber attack affecting integrity and authorization. The goal of this paper is to detect replay attack that is one of cyber attacks on the sensors of a control system. We propose a detecting method adding intentional noise to not only sensors as code signal but also input. Replay attack can immediately be reflected by using fault diagnosis matrices that are composed of the estimator and observed values even if code signal is decrypted. Finally, we show simulation results to analyze effectiveness of the proposed method.