A key management strategy based on cluster is given to guarantee wireless sensor networks secure. The sensing hypercube is divided into numerous the same small hypercubes with the same dimension with the sensing hypercube. Those small hypercubes are called as cells and 2 n cells consist of a cluster, where, n is the dimension. The wireless sensor network is a one-layer structure and consists of a lot of the same sensor nodes. Those sensors establish their shared keys through utilizing the idea of the unital-based scheme, and then all sensors can set up their secure connection and paths. Analysis shows that this strategy can guarantee the WSNs security, improves the network connectivity, has good scalability, and has lower storage requirement.