/Lets-Chat

A WIP multi-platform (Flutter) Matrix client app. Yeah, it was called Let's Chat in the beginning.

Primary LanguageDart

🗨️ Ciphera - Secure Messaging App

ScreenSelect_20241019_173432_Emulator ScreenSelect_20241019_173438_Emulator ScreenSelect_20241019_173809_Emulator ScreenSelect_20241019_173540_Emulator ScreenSelect_20241019_173824_Emulator ScreenSelect_20241019_173829_Emulator
Secure messaging was never this easy.

About this app

Ciphera is a decentralized multi-platform (Flutter) Matrix client messaging app. It allows for secure messaging with full support for end-to-end encryption using the Matrix REST API and the Olm/Megolm protocols.

Features

  • Decentralized: The backend server can be hosted by anyone.
  • Cross-platform support: This app is made in Flutter which supports building for all major platforms.
  • Secure Messaging: All data is AES-256 encrypted at rest
  • End-to-End Encryption: E2EE for direct chats using Olm/Megolm
  • Light/Dark Modes

Setup

Setting up Synapse

Synapse is an open-source Matrix homeserver implementation. We will be using this for our messaging service.

  • Go to synapse directory and run the following command:

    sudo docker run -it --rm
    -v $(pwd)/data:/data
    -e SYNAPSE_SERVER_NAME=<your ip address>
    -e SYNAPSE_REPORT_STATS=yes
    matrixdotorg/synapse:latest generate
  • A homeserver.yaml file will be generated in the data directory. We have to modify a few lines in this file so as to use Postgres database instead of the default SQLite. You might need to use terminal-based editors on Linux since these require admin privileges.

    # /data/homeserver.yaml
    # Change the database part
    ....
    ...
    database:
      name: psycopg2
      args:
        user: synapse_user
        password: your_password
        database: synapse
        host: postgres
        port: 5432
      allow_unsafe_locale: true
    ...
    ...
    # ..and a bit of server modifications to ease the registration process
    allow_public_users: true
    enable_registration: true
    enable_registeration_captcha: false
    enable_registration_without_verification: true
    suppress_key_server_warning: true
    rate_limiting:
      enabled: true
      per_second: 10
      burst_size: 20
  • Make docker containers.

    docker-compose up -d --build
    
    # check status of containers
    docker ps
    
    ## Stop compose
    docker-compose stop
    
    ## Start compose
    docker-compose start
    
    ## Register a user using cli
    docker exec -it synapse register_new_matrix_user http://localhost:8008 -c /data/homeserver.yaml -u username -p password --no-admin
Setting up Registration Server (optional if not using the register button in app)
  • Run the Flask app.

    cd registration-backend
    
    sudo pip install flask
    
    sudo python app.py
Building the Ciphera app

Since this app is made using Flutter, we can build and run applications for Linux, ChromeOS, Windows, Android and macOS. For further information, check Flutter website.

  • Run the app.

    cd flutter-app
    
    # get required programs to run on your desired platform
    
    # check devices
    flutter device
    
    flutter run