Wireless sensor networks routing protocols always neglect security problem at the designing step, while plenty of solutions of this problem exist, one of which is using key management. Researchers have proposed many key management schemes, but most of them were designed for flat wireless sensor networks, which is not fit for cluster-based wireless sensor networks (e.g. LEACH). In this paper, we investigate adding security to cluster-based routing protocols for wireless sensor networks which consisted of sensor nodes with severely limited resources, and propose a security solution for LEACH, a protocol in which the clusters are formed dynamically and periodically. Our solution uses improved random pair-wise keys (RPK) scheme, an optimized security scheme that relys on symmetric-key methods; is lightweight and preserves the core of the original LEACH. Simulations show that security of RLEACH has been improved, with less energy consumption and lighter overhead.