Wireless sensor networks are usually deployed in unattended areas. Wireless communication links are used for data transmission between sensor nodes. The resources of nodes such as calculation, storage, communication and energy are very limited. Information encryption is one of the core contents of information security. In a sensor network, each sensor node senses and collects various information needed by the network in its geographical environment according to its special functions, and transmits this useful information to the monitoring center for further processing in a multi-hop manner through encryption and wireless transmission technologies. Digital signature, identity authentication, password system and other technologies based on encryption technology can effectively maintain information security. It is of great significance to study encryption technology. This paper proposes a new secure location algorithm: symmetric cipher algorithm. This algorithm can effectively suppress malicious attacks of hijacked nodes. Symmetric cipher algorithm has no additional requirements on node hardware and can be used in ordinary wireless sensor networks.