GithubHelp home page GithubHelp logo

simplex-chat / simplex-chat Goto Github PK

View Code? Open in Web Editor NEW
5.4K 66.0 260.0 214.99 MB

SimpleX - the first messaging network operating without user identifiers of any kind - 100% private by design! iOS, Android and desktop apps 📱!

Home Page: https://simplex.chat

License: GNU Affero General Public License v3.0

Haskell 35.33% Dockerfile 0.02% Shell 0.59% Kotlin 31.31% CMake 0.13% C 0.43% Swift 24.17% Objective-C 0.01% Nix 0.47% Awk 0.01% HTML 2.48% CSS 1.09% TypeScript 1.55% JavaScript 1.23% Nunjucks 0.09% C++ 1.09%
chat protocol e2ee privacy haskell security messaging encryption double-ratchet

simplex-chat's Issues

Correctly show contact state while connection is in progress

I'm using Android v0.4.2

I've shared my link with exactly 1 person who I've confirmed didn't re-share my connection link. But I have two contacts in "Your chats". One is my friend and the other is someone jb. I've tried chatting at jb and the messages disappear from the screen.

I did click "Get help & advice via chat" and was shown a "Connect via contact link?" dialog with a "Connect" button. I did not click the "Connect" button and instead clicked on the background to dismiss the dialog.

I think it's likely that jb was added when I clicked "Get help" but the contact is not fully established and in a broken state because I rejected "Connect via contact" thing.

Comment on pros and cons of WebSocket API

+ no need for polling, hence messages can be pushed from server to receiver
- possible to correlate connections that are in the same session
- use via Tor (?)

maybe also that "send" via WS for active conversations would be premature optimization, that's why there's only "receive" API

Use separate keys to encrypt and to sign messages

  • Not okay to use the same EK to both encrypt and sign
  • it's actually not possible to verify messages in edge-messaging protocol if only one connection available, unless sender provides verification key (so in addition to SK to sign requests, sender needs to provide VK to verify messages).
  • it requires the same number of simplex connections for both parties in duplex (limited to the smallest number of servers available to each party); without this constraint two parties can use different number of simplex connections (redundancy level) defined by the number of servers available to them.

Desktop app (GUI)

Hi,

Thank you for this project. It's great to have a new secure messenger.

My suggestion is to make a GUI desktop app for Linux.

Thank you for your consideration.

Tweak invite button text on iOS

Current link when the invite web page shows on iOS browser is Open in mobile app. some users find this confusing.

Suggest new text Join Chat in Simplex or Accept Invitation in Simplex

Suggest new text above to replace Scan QR code.....the app. with To accept the invitation on this device, click on the Accept Invitation button below (please be sure you've installed and opened Simplex at least once). Otherwise, you can scan the barcode from the Simplex app.

The most likely path is invite from one iphone to another, so the QR code should be secondary.

ARM compatibility

Unfortunately the install script does not support ARM and manually building with stack on ARM fails too:

$ stack install -j2                                                                                            
/home/user/Projects/simplex-chat/simplex-chat.cabal was generated with a newer version of hpack,
please upgrade and try again.
Not cryptographic hash found for Hackage package cryptostore-0.2.1.0, updating
Selected mirror https://s3.amazonaws.com/hackage.fpcomplete.com/
Downloading root
Waiting to acquire cache lock on /home/user/.stack/pantry/hackage/hackage-security-lock
Acquired cache lock on /home/user/.stack/pantry/hackage/hackage-security-lock
Released cache lock on /home/user/.stack/pantry/hackage/hackage-security-lock
Selected mirror https://s3.amazonaws.com/hackage.fpcomplete.com/
Downloading timestamp
Downloading snapshot
Downloading mirrors
Cannot update index (no local copy)
Downloading index
Waiting to acquire cache lock on /home/user/.stack/pantry/hackage/hackage-security-lock
Acquired cache lock on /home/user/.stack/pantry/hackage/hackage-security-lock
Released cache lock on /home/user/.stack/pantry/hackage/hackage-security-lock
Updated package index downloaded
Calculating hashes to check for hackage-security rebases or filesystem changes
No old cache found, populating cache from scratch
Populating cache from file size 785956352, hash 3cc150b78048459609062d508546617f41e248c8eb41f5b72f53be5198286aab
Populating package index cache ...
Package index cache populated
Unable to find installation URLs for OS key: linux-aarch64-tinfo6

With how widespread ARM CPUs now have become, I think it would be a huge milestone if simplex-chat could run on this architecture.

Decide on encryption keys in the connection (same for all queues or one per queue)

Factor One key for all queues A key per queue
Connection request size (+) smaller (-) bigger
Management complexity (+) easier (-) harder - need to manage pairs of DH exchanged keys per pair of queues inside the connection
Correlation of messages (-) yes - same encrypted message can be correlated across queues and servers (+) no - encrypted messages will have different representation per queue

General suggestions and questions

First of all: thanks for the great project! It's really cool to see a true successor for IRC. Although it's in early stages, but current chat prototype works flawlessly, looking forward for mobile app.

While using the simplex-chat, I collected a few thoughts/suggestions:

  • It would be great if TAB could autocomplete commands; subcommands; contacts; file and directory names when using /f; etc. and arrow keys to scroll past commands like in your favorite interactive shell.
  • While we here: when user "drag'n'drops" file from file manager to terminal, file path contains trailing whitespace, so executing /f <file_path> would fail. I guess it would make sense if simplex-chat just ignored this.
  • Currently, simplex-chat prints everything (DMs, group messages, command output) in one window. Change TUI layout to something modular: split up chat to multiple tabs for each opened contact/group and create separate main tab for general info/command output. Something like irssi + tiny irc clients do:

bitmap

So, above user input (which also shows current user in use) there's multiple opened tabs with different colors: #fbf1c7ff #fbf1c7ff means current tab, #fb4934ff #fb4934ff – you've been mentioned, #b16286ff #b16286ff – there's new messages and #504945ff #504945ff – no messages. It's just a concept and if you have something on your mind already – feel free to ignore this ;^)

  • Changing TUI layout as suggested in previous section would require making some kind of bindings/shortcuts (like left/right arrow keys to change tabs). So, implementing configuration file with user settings, so user can change bindings and other stuff (like default simplex server) would be also great.
  • Show past history and messages with date and time. It would be also ideal if chat history could be scrolled with Ctrl+UP/Ctrl+DOWN or similar.
  • Implement new command /contact which would list all available users/groups to message.
  • Currently, Linux releases contain dynamically linked executable, compiled in glibc environment, which makes it impossible to execute binary on systems with musl libc (like Alpine Linux). I was able to successfully compile fully statically-linked simplex-chat binary with Alpine Linux, so I think that shouldn't be too hard. Distributing such static binary will provide universal Linux coverage for both glibc and musl distributions.

And I've got a bunch of questions from user perspective:

  1. Is it possible to find out which available public groups simplex-chat/simplexmq#143 (in the future) can I connect to?
  2. What is the difference between the current E2EE algorithm and the well-known protocols like Signal Protocol, OMEMO and Matrix Olm/Megaolm?
  3. What happens in the following scenario: I've created my db with user named Alice and chose SMP server smp.example.com. Then, I've executed /c and server generated ID (as described in simplex queue if I was able to understand this correctly) for my connection. I've sent this invitation to Bob and we successfully established connection. But then, after closing my client, I chose another SMP server smp.example2.com. Do i need to generate another ID for smp.example2.com or SMP servers somehow exchange information between each other?

Well, that's all I've got.

Wrong binary in v1.0.3 release?

When I re-installed for version 1.0.3 using the install script I noticed that the version printed on login is 1.0.0

I then copied the binary from the release and sure enough the version printed is still 1.0.0 so either the binary is wrong or the version coded into the binary is wrong.

Rename edge-messaging protocol

as discussed naming implies a graph on a higher level of abstraction which is not explicitly defined in the lower level protocol and not necessarily needed for some other possible domain reusing it.
possible name: simplex-messaging protocol

Improve simplex connection privacy and integrity

Several protocol improvements are possible to provide higher level of communication privacy and integrity (delivery guarantee of unmodified message):

  • fixed message size of 8kb (smaller messages are padded with random content, bigger messages are delivered as large messages - see implementation spec, higher level duplex protocol may split larger messages into multiple). 8kb is the standard chunk used in UNIX / http. It makes impossible traffic correlation by message size.
  • minimal required padding size - it may be redundant if required padding is built into encryption protocol - TBC. The goal is to avoid repeated messages.
  • additional server side encryption before saving to DB using additional key provided by recipient at the time connection is created. It makes impossible traffic correlation by message content. It is not necessary because of transport encryption
  • some RK/SK keys validation to reduce probability of MITM attack between participants and the server - maybe redundant, maybe on duplex connection level - TBC
  • additional unencrypted message timestamp SK-signed by the sender with the server rejecting the message if the difference with the server clock is over 1-2 min (TBC). Both server and client time stamps will be forwarded to the recipient (in addition to client side timestamp inside the message).
  • the signed hash of the previous message is included into the message body, so the recipient can validate that no message is lost or modified (separate blockchain in each simplex connection). It makes impossible deleting or replacing messages from the server without recipient noticing it - should be part of duplex communication protocol.

bug with sending file

Hi
v0.4.0
simplex-chat-ubuntu-20_04-x86-64
on Manjaro

./simplex -d alice
./simplex -d tom
mkdir alice
nano ./alice/file (wrote some text)

# /f @tom ./alice/file
use /fc 11 to cancel sending


# ./simplex -d tom
14:29 alice> sends file file (10 bytes / 10 bytes)
use /fr 11 [<dir>/ | <path>] to receive it
# /fr 11 ./tom
saving file 11 from alice to ./tom/file
started receiving file 11 (file) from alice
error receiving file: incorrect chunk size

received file with 0 byte

Markdown composition

How I can compose the markdown notations? for example, I like bold underline text in red? !1 +*bebop*+! is not working.

Thanks!!

push message to multiple sessions

I opened two simplex-chat in two terminal windows. Both can send message, but only 1 (later opened) can receive message. How can I have both sessions updated with received messages? Otherwise I will need to remember the last opened window to see the conversation.
Thanks

No obvious way to "Share Link" on android

Android app v0.4.2
It says that I can share either a QR code or a link, but there's nothing obvious to click on for the link. I did find if I tap a bunch of times between the QR code and the home button on my phone, it eventually pops open the Android share dialog and I can copy the link to my clipboard.

I think there's probably a button that's rendered off screen. I'm using a Galaxy S10e and haven't enabled any accessibility options (like increased font size)

Secrets get shown in plaintext!!

Here is the bug:
(Android 12 | Pixel 5)
I sent myself a secret message from my PC via CLI and the secret displays in the notification on the lock screen in plain text.

in Transport.hs: T.getPeerFinished not found

I made a cabal build, and got the same as in the hackage CI:

``[tags/v1.0.0] % cabal build
Build profile: -w ghc-8.10.6 -O1
In order, the following will be built (use -v for more details):

  • simplexmq-1.0.0 (lib) (first run)
  • simplex-chat-1.0.0 (lib) (first run)
  • simplex-chat-1.0.0 (exe:simplex-chat) (first run)
    Preprocessing library for simplexmq-1.0.0..
    Building library for simplexmq-1.0.0..
    [11 of 28] Compiling Simplex.Messaging.Transport ( src/Simplex/Messaging/Transport.hs, /home/me/programming/haskell/simplex-chat/dist-newstyle/build/x86_64-linux/ghc-8.10.6/simplexmq-1.0.0/build/Simplex/Messaging/Transport.o, /home/me/programming/haskell/simplex-chat/dist-newstyle/build/x86_64-linux/ghc-8.10.6/simplexmq-1.0.0/build/Simplex/Messaging/Transport.dyn_o )

src/Simplex/Messaging/Transport.hs:284:27: error:
Not in scope: ‘T.getPeerFinished’
Module ‘Network.TLS’ does not export ‘getPeerFinished’.
|
284 | cxtFinished TServer = T.getPeerFinished
| ^^^^^^^^^^^^^^^^^

src/Simplex/Messaging/Transport.hs:285:27: error:
Not in scope: ‘T.getFinished’
Module ‘Network.TLS’ does not export ‘getFinished’.
|
285 | cxtFinished TClient = T.getFinished
| ^^^^^^^^^^^^^
cabal: Failed to build simplexmq-1.0.0 (which is required by exe:simplex-chat
from simplex-chat-1.0.0).

1 ~/programming/haskell/simplex-chat (git)-[tags/v1.0.0] % ghc --version
The Glorious Glasgow Haskell Compilation System, version 8.10.6
me@here ~/programming/haskell/simplex-chat (git)-[tags/v1.0.0] % cabal --version
cabal-install version 3.4.0.0
compiled using version 3.4.0.0 of the Cabal library ```

SimpleX chat - v0.4.1 release

  • chat protocol #66
  • user profiles #69, #93
  • chat groups #75, #76, #77, #78, #84, #85, #87
  • merge contact profiles when existing contact is invited to group by another member #86
  • asynchronous message delivery (messages can be sent when the client is offline) #92
  • #94
  • #97
  • #91
  • message delivery to pending group members
  • #98
  • docs
    • #99
    • chat protocol
  • group improvements:
    • show notification when member is connected to all members
    • message integrity based on Merkle DAG

Explain differences/advantages over p2p

  1. much simpler design than DHT
  2. higher delivery guarantee, as the recipient controls the server choice
  3. no global identity of any form, even temporary
  4. solves MITM attack problem, unlike p2p
  5. uses standard web protocols - much less likely to be blocked
  6. Can run on the same servers as public websites
  7. No server discoverability
  8. Impossible to attack/flood the whole system using Sybil attack - the system is fragmented, servers are not connected and not known, clients only communicate with known servers.

Note on "disabling" connection before deleting

To avoid losing messages.

It can be done in one of two ways:

  • by changing the sender key, so that new messages from sender will be rejected - currently it is not allowed (line 178), but can be changed.
  • by introducing connection "active/disabled" flag and API to change it.

Please clarify the 'problems' listed in readme

Problems

Existing chat platforms and protocols have some or all of the following problems:

  • privacy of the conversation, partially caused by E2EE implementations.
  • privacy of the user profile and connections.

Why is privacy a problem?

Describe how to check for MITM between the server and the receiver

Receiver can check for MITM between him and his server by asking the real sender to test a request signed by the receiver on the receiver's server via sender's URI (that is via a specific endpoint). This signed request can be passed to the sender:

  • either via initial QR
  • or via a duplicate simplex (this can be done on a regular basis as a preventive measure)

Or we can do both.

As a sidenote,
There can be no MITM between the sender and the receiver's server because sender's key (SK) is saved on the server by the receiver via signed request.

Explain why asymmetric key (public) is passed off-band (and why not pass symmetric keys)

Draft:

It's more secure against an eavesdropping attacker. The keys that the receiver generates for the sender can be intercepted off-band via any channel except camera - email, video call, mutual trusted friend. Even if public key is intercepted off-band it only allows a passive attacker to encrypt a message, but not to decrypt it.

If an active attacker intercepts a public key and tries to act as a sender, the real sender won't be able to create a simplex channel (i.e. will be denied by the server) and he will then communicate this to the receiver off-band.

simplex name is not catchy

Hi,

I am very glad that Haskell ecosystem can provide such cool tool for broad audience, but I am concerned with name.

  • word simple has negative associations
  • simplex makes me think about X window manager
  • simplex-chat is 2 words
  • simplex is not related to info propagation (compare with whatsapp, messenger, telegram)
  • Google Play has other apps with same name

Create files in XDG directories by default

I just found out about simplex-chat and I love it already. What sold me on it is the CLI. I know in advance it will be hard to convince people to leave their preferred chat platform, as usual, but it will definitely be worth trying.

One thing I dislike, however, is that simplex-chat creates a ~/.simplex/ folder for its sqlite files. I think it would be better and tidier to stick to XDG standards and store those files in ~/.local/simplex by default, and only use ~/.simplex/ if XDG directories do not exist.

For reference, here is a similar reflexion for newsboat: https://github.com/newsboat/newsboat/issues/1711 (I am backticking to avoid adding a reference in their issue).

Android 9 support

I wanted to try the app and realized that it is not available for my device (Motorola g7).
It is a very cheap and popular gadget.

SimpleX chat protocol and mobile app MVP

  • agent protocol extensions/improvement
    • message receipts (ACK/RCVD)
    • confirmation/approval steps (CONF/LET)
    • "small" client-based groups
    • agents cluster (device sync)
  • chat protocol:
    • profiles
    • message formats
    • how agent protocol is used for various chat scenarios
    • chat groups: protocol to identify and confirm user connections in groups
  • SMP server
    • Websockets support
    • server deployment: linode and digital ocean
  • SMP agent: manage JOIN when the initiating agent is not online
  • terminal UI
    • upgrade for chat protocol
    • system notifications
  • mobile app:
    • websockets vs TCP decision
    • app system design (cordova + react)
    • setup cordova + react app
    • UX - decide on the flow of profiles and adding contacts
    • fully private mode (no sharable user profile, as now in the terminal)
    • chat protocol
    • IndexDB store: current methods for the agent
    • IndexDB store: additional methods for chat UI
    • picture and file transmission: WebRTC or SMP streams?
  • simplexmq-js:
    • SMP protocol (types, parsing/serialization)
    • SMP agent protocol (types etc)
    • SMP client
    • SMP agent
    • Abstract transport, WebSockets (?) implementation
    • Abstract cryptography class, WebCrypt implementation
    • Client handshake

Simplify simplex messaging

Other questions to simplify

  • Maybe the keys should not be replaceable as well and the only needed endpoint is to secure connection which is only possible once? In this case duplex protocol would do full connection rotation (rather than key rotation).
  • Is ID really needed?
  • Remove "disable" option

WindowsCli

Can't mark the invitation link in the client it to send to another user.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.