Routing is a challenge in cognitive radio networks (CRNs) due to the properties of cognitive radio (CR) technology, as well as other limitations. Firstly, the CR's frequency band is considered a dynamic spectrum. Therefore, since the routing algorithms used in other types of networks rely on a fixed frequency band, they cannot be directly used in CRNs. Secondly, the dynamic spectrum access, which is enabled by CR technology, negatively affects the network performance. Thirdly, having an effective routing in CRNs needs a local and continual knowledge of its changeable environment. Lastly, the presence of adversary nodes and their malicious activities affect the route establishment process, thereby reducing the network performance. This paper addresses these limitations by combining the spectrum sensing and the spectrum management phases by proposing a novel and secure routing algorithm. Security in the proposed algorithm combines two aspects. The first aspect is measuring the nodes' behavior during the spectrum sensing phase through a parameter called belief level (BL), which refers to the nodes' reliability to correctly find and use the white spectrum channels. The second aspect is securing the routing request and reply messages by encoding them with the existing cryptography techniques. The main goal of the proposed approach is to make the available paths between any two communicating nodes secure, reduce the negative effects to the licensed users over the spectrum channels, and moderate the total cost of the used channels over the best path(s). The performance evaluation in terms of end-to-end delay, packet delivery ratio, packet loss ratio, and routing overhead show that the proposed approach outperforms multiple existing routing algorithms. Moreover, the proposed algorithm is validated and verified in terms of security functionality against any attacks.