GSoC Final Report — Aossie

Ritik Jain
4 min readAug 21, 2021

--

Hello guys, the second evaluation of the GSoC period has begun. The past 10 weeks were full of learning for me and I had a great learning experience. This blog post is a report of the work done that I have accomplished in this GSoC period for the peer-to-peer message transfer project.

Project link: https://gitlab.com/aossie/p2p-messaging-react-native

Introduction

The project aims to design and develop a Peer-to-Peer Messaging app that does not rely on a central server to intermediate the messages across the peers. The app is intended to provide privacy, high communication efficiency, censorship resistance, and extra resilience to the users. Today we are dependent on social media platforms more than ever and these social-media platforms might take unfair advantage of the user data regardless of their privacy concerns. Therefore, a solution to this problem would be an app that does not rely on these intermediate servers (platforms) to relay the messages, hence the vulnerability of the user data would be protected and the much-needed respect would be given to the user's privacy.

Also, the app intends to provide users with peer-to-peer communication independent of network connectivity. This can be extremely useful in disaster-prone and remote areas (or even in case of a network outage) where network connectivity might not be a go-to thing. Hence, the app would be reliable and secure at the same time which is the main motivation to develop this application.

Implementation

The mode of transportation for the payload/messages is Bluetooth/WiFi. We are using the Nearby Connection API developed by Google to facilitate P2P offline communication. In order to increase the bandwidth for the communication range, we have introduced a simple hopping architecture based on the GossipSub protocol. So, let’s say there are three devices A, B, and C, where A and C are not in communication but B is in the communication range of both of A and C devices, we will use the B device as an intermediate node to relay our message from A to C. In this way, we can increase the bandwidth of the app.

Google’s nearby connection API does not have any wrapper for the latest versions of react-native apps. Hence, a module is being developed in this GSoC period in order to port java code to be utilized in react-native. The future goal of this module would be a dedicated npm package for Nearby Connection API that can later be directly used in the app.

In order to make the app secure and end-to-end encrypted, we have used RSA Asymmetric encryption. In this algorithm, we have a pair of public and private keys. A user encrypts the message with the public key of the target peer. This message can only be decrypted with the private key of the target peer. In this way, an interceptor cannot understand/decrypt the message thereby making the app safe and secure.

The public keys have to be shared beforehand among the peers before they can start communicating with each other.

Technologies used

  • React-Native
  • Google Nearby Connection API
  • RSA Asymmetric Encryption

Merge Requests

Challenges

The main challenge for me in the development of this project was to port the native code to react-native for Google’s Nearby Connection API. In the future, as I have mentioned above the main modus operandi will be to develop an entire npm package for the same which will then become a dependency on the app.

Extra Reads

Lastly, I am really grateful to my mentors — Bruno, Thuvakaran, Madhav, and Aditya from whom I learned a lot, and also a big thanks to my team members, Harjeet and Tanya for helping me throughout GSoC journey.

Please feel free to ask any doubts regarding the implementation and I will be contributing further to improve the app.

Cheers :)

--

--

Ritik Jain
Ritik Jain

Written by Ritik Jain

Turning caffeine and ideas into code

No responses yet