https://github.com/craigyanitski/mescli
An end-to-end encrypted messaging app that runs in a terminal
Science Score: 26.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
○DOI references
-
○Academic publication links
-
○Academic email domains
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (14.3%) to scientific vocabulary
Keywords
Repository
An end-to-end encrypted messaging app that runs in a terminal
Basic Info
Statistics
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
- Releases: 0
Topics
Metadata Files
README.md
MESCLI
Introduction
MESCLI will be a CLI messaging app, and is currently in development. I want secure end-to-end encryption of the messages, as well as a double-ratchet for improved security. There will preferably be markup support, eventually including a maths mode. It is not yet known whether a server will be made public (obviously a public server is necessary to make this functional beyond testing). More likely than not, this will have many iterations over several stages.
Motivation
I am fascinated by cryptology, so I wanted to attempt my own implementation of
an end-to-end messaging service.
For the double-ratchet algorithm I am implementing for this app, I am using as
a guide the very thorough Signal protocol
specifications.
One can also find there a description
of the extended triple-Diffie-Hellman (X3DH) asynchronous key exchange that is
also implemented in mescli.
Installing / Building
I currently have two executables you can build: one for the server and the
other for the client.
Since MESCLI is actively developed and not yet deployed, this defaults to
serving on the local host.
You can compile and run the client executable (called mescli) using,
bash
make build
./mescli
It uses a configuration file from the current directory (this will change soon).
This file will hold the user's identifying keys as well as the ratchet keys and
their conversations.
In order to be cryptographically secure, messages are not stored on the server.
There is not much to test now other than creating an account on the server and
initialising your keys.
I am currently writing handlers for the messages endpoint.
The server executable can also be compiled and run using,
bash
make build-server
./server
The server interacts with a PostgreSQL database, and the required migrations
are stored in ./sql/schema and run using goose.
In order for the server to run correctly, it expects a .env file in the root directory
with environment variables DB_URL (defined by the PostgreSQL database) and
JWT_SECRET, a base 64 encoded string used for authenticating users.
You can generate your own 32-byte key using,
bash
openssl rand -base64 32
Development
Since the full project is rather complex, I will focus on a few features for the first stage. Many of the more complex features making it useful will be deferred to a later release.
- [x] Format text with ANSI codes
- [x] replace with glamour/lipgloss
- [x] Generate client- and server-side keys
- [x] Synchronise client KDFs
- [x] Encrypt messages before sending through server
- [x] Decrypt server response
- [x] Format display
- [ ] ~Use DH generation for each message with KDF~ DEFERRED until after server setup
- [x] Create a TUI
- [x] create TUI framework (bubbletea)
- [x] implement Markdown rendering
- [ ] implement encrypted messaging
- [ ] ~Allow non-local users~ DEFERRED (might deploy on AWS)
- [x] develop server code
- [ ] ~Format maths env~ DEFERRED to different project extending goldmark
- [ ] ~use MathJax with glamour~ DEFERRED
Issues
The maths formatting is deferred until I find a reasonable method to format maths in a TUI. I don't know if I want to make some dependency or attempt to write it myself.
I will also make this functionality as a local experiment for now, deferring any public functionality until a much later date.
There are obvious legal reasons for and against full end-to-end encryption on a public service. I do not want to go through this just for a small project; I just want to test a double-ratchet encryption.
Contributing
Consider contacting me before trying to contribute. I am happy to review any improvements you devise.
clone the repo
bash
git clone https://github.com/CraigYanitski/mescli@latest
cd mescli
Then implement a new process, create some tests for your contribution, and submit a pull request. I should be able to respond within a day :-)
Owner
- Name: Craig Yanitski
- Login: CraigYanitski
- Kind: user
- Location: Köln, Germany
- Company: Universität zu Köln
- Repositories: 2
- Profile: https://github.com/CraigYanitski
GitHub Events
Total
- Push event: 156
- Create event: 2
Last Year
- Push event: 156
- Create event: 2
Dependencies
- github.com/alecthomas/chroma/v2 v2.14.0
- github.com/atotto/clipboard v0.1.4
- github.com/aymanbagabas/go-osc52/v2 v2.0.1
- github.com/aymerick/douceur v0.2.0
- github.com/charmbracelet/bubbles v0.20.0
- github.com/charmbracelet/bubbletea v1.3.0
- github.com/charmbracelet/glamour v0.8.0
- github.com/charmbracelet/lipgloss v1.0.0
- github.com/charmbracelet/x/ansi v0.8.0
- github.com/charmbracelet/x/term v0.2.1
- github.com/dlclark/regexp2 v1.11.0
- github.com/erikgeiser/coninput v0.0.0-20211004153227-1c3628e74d0f
- github.com/gorilla/css v1.0.1
- github.com/lucasb-eyer/go-colorful v1.2.0
- github.com/mattn/go-isatty v0.0.20
- github.com/mattn/go-localereader v0.0.1
- github.com/mattn/go-runewidth v0.0.12
- github.com/mattn/go-runewidth v0.0.16
- github.com/microcosm-cc/bluemonday v1.0.27
- github.com/muesli/ansi v0.0.0-20230316100256-276c6243b2f6
- github.com/muesli/cancelreader v0.2.2
- github.com/muesli/reflow v0.3.0
- github.com/muesli/termenv v0.15.2
- github.com/muesli/termenv v0.15.3-0.20240618155329-98d742f6907a
- github.com/rivo/uniseg v0.1.0
- github.com/rivo/uniseg v0.2.0
- github.com/rivo/uniseg v0.4.7
- github.com/sahilm/fuzzy v0.1.1
- github.com/yuin/goldmark v1.7.1
- github.com/yuin/goldmark v1.7.4
- github.com/yuin/goldmark-emoji v1.0.3
- golang.org/x/crypto v0.32.0
- golang.org/x/net v0.27.0
- golang.org/x/sync v0.10.0
- golang.org/x/sys v0.0.0-20210809222454-d867a43fc93e
- golang.org/x/sys v0.6.0
- golang.org/x/sys v0.29.0
- golang.org/x/term v0.28.0
- golang.org/x/text v0.21.0