Nowadays, the major part and most standard networks usually used in several applications are Wireless Sensor Networks (WSNs). It consists of different nodes which communicate each other for data transmission. There is no access point to control the nodes in the network. This makes the network to undergo severe attacks from both passive and active devices. Due to this attack, the network undergoes downgrade performance. To overcome these attacks, security based routing protocol is proposed with the security based wormhole detection scheme. This scheme comprises of two phases. In this approach, the detection of wormhole attacks is deployed for having correct balance between safe route and stability. Also, to ensure packets integrity cryptographic scheme is used as well as authenticity while travelling from source to destination nodes. By extensive simulation, the proposed scheme achieves enhanced performance of packet delivery ratio, end to end delay, throughput and overhead than the existing schemes.