Routing is a fundamental networking function in every communication system, and multi-hop wireless networks are no exceptions. Attacking the routing service, an adversary can easily paralyse the operation of an entire network. The malicious manipulation of some routing messages results in the dissemination of incorrect routing information which can eventually lead to network malfunction. Even more, intermediate nodes can be corrupted, and thus, exhibit arbitrary behavior. Due to the subtle nature of attacks against routing protocols, informal reasoning about wireless routing security is an error-prone method. In this work, I develop a formal framework in which precise definitions of secure routing can be given, and secure routing protocols proposed for multi-hop wireless networks can be rigorously analysed. I demonstrate the usefulness of this framework in two ways: first, I prove the security of several existing routing protocols. Second, applying the design principles that wereidentified during the analyses, I propose novel routing protocols for wireless ad hoc and sensor networks and I prove that they are secure in my model.