A Delay Tolerant Network (DTN) relies on the implicit assumption that nodes cooperate towards message forwarding. However, this assumption cannot be satisfied when there are malicious nodes acting as blackholes and voluntarily attracting and dropping messages. In this paper, the authors propose a reputation-based protocol for contrasting blackholes. Every node locally maintains the reputation of forwarding nodes it comes in touch with and, then, upon selecting the next forwarding node, the node chooses among those having the highest reputation. The proposed reputation protocol is composed of three basic mechanisms - acknowledgments, node lists, and aging - that make communication efficient and capable of adapting to the changing operating conditions of a DTN.