Smartphones are essential tools for everyday tasks and are widely used for a multitude of communication services. Services such as video streaming, content sharing or instant messaging require users to have an internet connection in order to connect to a central server. However, in out-of-coverage areas such as the mountains or in areas where the infrastructure is damaged, phones are unable to establish a connection to the server. As a consequence, these services become unavailable. This can be critical during natural disasters and rescue operations where user's connectivity can make a significant difference.In out-of-coverage areas, smartphones equipped with Wi-Fi radio may make use of the radio to establish a Peer-to-Peer (P2P) network with other users in the vicinity. This would then enable users to communicate through the established network. However, unlike ordinary Wi-Fi settings that use a dedicated Wi-Fi base station, in a P2P setting every device has the opportunity to assume this master role and the communication has to be adjusted accordingly. To achieve this, other Wi-Fi technologies, such as Wi-Fi Direct and Wi-Fi Aware, are needed.The P2P approach also presents new challenges in several aspects of security due to a lack of connection to a central server. In particular, the authentication of users is essential to ensure the identity of the communicating parties. Besides, users want to make sure they are not talking to an imposter and that their messages are not read or tampered with in the process. Thus, the main challenges are how to provide authentication of users and how to ensure the integrity and confidentiality of messages in internet-isolated P2P network.The goal of the master thesis is to design, implement and validate a solution for instant messaging when there is no internet connection. The proposed solution will enable secure and mutually authenticated communication among a group of devices in the vicinity. While Wi-Fi Aware will be used as the communication technology, an investigation that compares our solution with other related solutions will also be performed. In order to validate the solution experimentally, a proof-of-concept instant messaging application will be developed.