Wireless sensor networks have found applications in several areas such as agriculture, healthcare, weather forecasting, and the Internet of Things. Due to their extensive use WSNs are susceptible to several significant network threats. Therefore, they necessitate the implementation of advanced security measures. An issue of significant concern is the possible violation of user privacy resulting from the transmission of data. The rapid increase in online transactions and the vast volume of data generated on a daily basis have elevated information security to an important concern in the present era of the internet. Cryptography serves as a durable remedy to these issues by bolstering the confidentiality of data transmitted across the internet. This study analysed many characteristics, such as the total execution time, memory needs, number of packets sent to the base station, number of dead nodes, remaining energy after transmission, and the use of RSA algorithm and Elliptic Curve Cryptography. The simulation is executed in MATLAB utilising pre-defined parameters and constants. A WSN observation scenario was demonstrated with a fixed number of rounds (200) and varying numbers of nodes (5, 10, 15, and 20). The researchers computed the average ratio of packets transferred to the base station, inoperative nodes, and leftover energy after transmission. The upper limit for the number of packets that can be successfully transmitted to the base station using AES is 55%. This is subject to the condition that at least 40% of the nodes are inactive and a maximum of 45% of the nodes have residual energy. The primary achievement of the current work is the identification of the most effective energy-efficient encryption algorithm, as previous research has not focused extensively on this particular characteristic. Based on the simulation results, AES outperforms RSA and Elliptic Curve Cryptography in terms of packet transmission, inactive nodes, and energy conservation.