In this thesis, we investigate security in opportunistic communications. This new communication paradigm involves storing and carrying messages in addition to forwarding and impacts all security aspects of communication. Indeed, nodes' high mobility implies that security solutions should be dynamic and local. Furthermore, delay tolerance, which is one of the main characteristics of opportunistic networks, has a strong impact from a security perspective as it amounts to the infeasibility of interactive protocols.
Moreover, radically new forwarding strategies have been proposed to enable communication in opportunistic networks: parting from traditional network addresses, these enriched forwarding strategies use information such as context of a node or content of a message to take forwarding decisions. Context or content are sensitive information that users might not want to reveal to others in order to preserve their privacy, hence these information should be carefully handled to ensure their secrecy. The conflicting requirements between security and forwarding motivate the need for new security mechanisms that enable computation on encrypted data.
After analyzing the security challenges in opportunistic communications, we propose a complete security framework for context-based communication. This framework features not only data confidentiality and user privacy, but also computation assurance, which provides resilience against malicious entities aiming at disrupting or subverting the communication. We also propose a privacy-preserving content-based protocol which relies on multiple encryption layers, and an associated local and topology-dependent key management solution.