Cryptography helps solve many computer and communication problems, including clock synchronization, where a group of nodes wants to agree on a theoretically unique clock in the system with the presence of malicious nodes trying to prevent the process of convergence; so we will need a set of mechanisms, including encryption. Many synchronization techniques suffer from high power consumption or vulnerability to attack or difficulty of implementation. In this article, we propose a synchronization protocol that contains two parts. The first part uses a lightweight linear scheme to encrypt clock messages to fend off certain types of attacks such as message manipulation. This scheme is suitable for Wireless sensor networks (WSNs) with negligible encryption and decryption time. The second part is the process of calculating the clock based on a very simple consensus algorithm. The study of the proposed protocol has shown very satisfactory results.