Attribute-Based Encryption (ABE) is one of the public-key cryptographic techniques which enforces a new method of security through effective control of access on the data which is stored or communicated in encrypted form using a variety of user defined access restrictions. ABE is implemented in a fully-fledged computer system, such as smartphones or embedded devices and it can be also used to enhance the security of network communication. In Attribute-Based Encryption, the encryption key will be associated with a set of attributes and these attributes are useful in the decryption process as well. Encrypting the data for numerous receivers can also be done with ABE, in such a way that only those with the right permissions can decrypt it later. The ABE provides a high level of security due to the wide range of key based qualities that can be defined, and it is also flexible enough to be used in a variety of communication and storage situations. In Wireless Sensor Networks (WSNs), the information is transmitted through wireless links from the sensors to a central location called the sink node. The nodes present in WSN are required to carry out the task of monitoring the environments, gather the necessary data through sensing, encrypt them and send them to the sink node. Therefore, security is a major concern for wireless communication since data is transmitted via an open wireless channel that can be accessed by malicious intruders. In order to handle the security problem, we propose a new Attribute-Based Encryption and Trust Based Secure Routing Algorithm (ABE-TBSRA) strategy by combining bilinear pairing and Diffie Hellman encryption scheme with RSA algorithm to encrypt and secure the data at the sender-side itself. In addition, we propose a new trust-based security model that uses three types of trusts namely direct, indirect, and historical trust values for improving the security. The major advantages of this proposed encryption and trust based secure routing algorithm include the enhancements in security level as well as packet delivery ratio, reliability of transaction and also the network throughput with reduced energy consumption and delay.