Sensor nodes used to transmit sensitive data, especially in military applications, require securing the data transmitted through the WSNs to maintain the confidentiality of the data and authenticate the participating sensor nodes. Since sensor nodes suffer from limited resources, in memory storage, computing power, energy capabilities and transmission rates, available network security protocols are inadequate. Symmetric algorithms cannot provide the same degree of security as public key algorithms, leading us to devise a new algorithm SHESP that uses public keys within the limitations of sensor nodes. This paper presents a way to utilise existing public key algorithms such as RSA, Diffie-Hellmann and elliptic curve in the field of WSN security by dividing the network into clusters. Our algorithm supplies data confidentiality, node authentication and data integrity while remaining within acceptable memory, time and energy constraints. We provide theoretical and experimental evidence to validate our algorithms. Results reveal significant improvement in data availability, data confidentiality and authenticity while reducing the communication and computation overhead.