{"id":18273881,"url":"https://github.com/fabiocolacio/mercury","last_synced_at":"2025-07-19T10:32:57.121Z","repository":{"id":57660416,"uuid":"146825887","full_name":"fabiocolacio/Mercury","owner":"fabiocolacio","description":"An end-to-end encrypted chat service.","archived":false,"fork":false,"pushed_at":"2019-12-22T02:58:55.000Z","size":182,"stargazers_count":2,"open_issues_count":9,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-09T03:41:34.618Z","etag":null,"topics":["certificate","chat","chatroom","e2e","e2e-encryption","mercury","mercury-server","ssl","tcp"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"zlib","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fabiocolacio.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-08-31T01:32:30.000Z","updated_at":"2021-08-28T10:29:24.000Z","dependencies_parsed_at":"2022-08-25T17:01:32.258Z","dependency_job_id":null,"html_url":"https://github.com/fabiocolacio/Mercury","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/fabiocolacio/Mercury","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fabiocolacio%2FMercury","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fabiocolacio%2FMercury/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fabiocolacio%2FMercury/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fabiocolacio%2FMercury/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fabiocolacio","download_url":"https://codeload.github.com/fabiocolacio/Mercury/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fabiocolacio%2FMercury/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265916013,"owners_count":23848659,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["certificate","chat","chatroom","e2e","e2e-encryption","mercury","mercury-server","ssl","tcp"],"created_at":"2024-11-05T12:07:52.503Z","updated_at":"2025-07-19T10:32:57.100Z","avatar_url":"https://github.com/fabiocolacio.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Mercury Chat\n\nMercury is my end-to-end encrypted chat protocol.\nThis repository is currently the home of the server-side code.\nThe prototype client can currently be found [here](https://github.com/fabiocolacio/quicksilver).\n\n## Protocol\n\nThe current protocol is relatively simple.\nIt was inspired by the *Double Ratchet Algorithm* implemented by Open Whisper Systems for their app *Signal*.\n\nEach Alice would like to initiate a conversation with a new peer, they must both create elliptic-curve Diffie-Hellman parameters, and exchange their public parameters.\nEvery time Alice sends a message to a peer (such as Bob), she creates a shared secret using her private parameters and Bob's public parameters.\nShe encrypts the message using this shared key, and sends it to Bob.\nEach time she sends a message, she also creates new Diffie-Hellman parameters, and sends the public component alongside the message.\n\nNo two messages are ever encrypted with the same secret, because each time a message is received, the Diffie-Hellman parameters are updated and the shared-secret changes.\n\nThis is the structure of a message:\n\n```\nSid: The id of the sender's DH parameters used for this message\nRid: The id of the receiver's DH parameters used for this message\n IV: The initialization vector used for AES-CBC encryption of encrypted fields\nNxt: The sender's newly created public DH parameter for use on the next message (encrypted)\nMsg: The encrypted message\nKey: The encrypted HMAC key\nTag: HMAC integrity tag - HMAC(Nxt || Msg, Decrypted HMAC key))\n```\n\n## Future Plans\n\n* Group chat\n* Voice/video support\n* Blockchain-based trustless keyserver integration (removes need to manually coordinate initial key-exchange)\n* Docker image\n* Better (mobile?) client\n\n## Installing\n\nAfter installing golang and MySQL, run the installer with this command:\n\n```\ncurl https://raw.githubusercontent.com/fabiocolacio/Mercury/master/install.sh -sSf | sh\n```\n\n## Configuration\n\nIn order to run the server, you must first write a configuration file in the ``toml`` format, specifying the following details:\n\n* HttpAddr\n  * The address and port to bind the HTTP server to.\n  * HTTP requests are simply redirected to the HTTPS server.\n* HttpsPort\n  * The address and port to bind the HTTPS server to.\n* CertFile\n  * The absolute path to your server's certificate.\n  * For information about acquiring a certificate, see [the wiki](https://github.com/fabiocolacio/Mercury/wiki/Acquiring-an-SSL-Certificate)\n* KeyFile\n  * The absolute path to your server's private key.\n  * For information about acquiring a key, see [the wiki](https://github.com/fabiocolacio/Mercury/wiki/Acquiring-an-SSL-Certificate).\n* LogFile (Optional)\n  * The absolute path to a log file to maintain\n  * If this is not set, the server logs to stdout, which can be redirected as you please\n  * The file will be appended to if it already exists\n* SQLUser\n  * The user which will perform operations on the SQL database\n* SQLPass\n  * The password for SQLUser\n* SQLDb\n  * The SQL database that mercury will use for its tables\n\nYou should save your configuration file to ``/usr/local/share/com.github.fabiocolacio.mercury-server/config.toml``.\n\nA sample configuration file, ``sample-server.toml``, can be found in the ``res`` directory.\n\n## Usage\n\nWhen running mercury for the first time, use the ``--init`` flag.\nThis will create all necessary tables in the database.\nUse this flag with caution!\nIf the tables already exist, *it will delete and reset them*.\n\n```\nmercury --init\n```\n\nmercury looks for a configuration file in ``~/.config/mercury/config.toml`` by default.\nYou may specify another config file with the ``--config`` flag.\n\n```\nmercury --config ~/path/to/configuration/file/config.toml\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffabiocolacio%2Fmercury","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffabiocolacio%2Fmercury","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffabiocolacio%2Fmercury/lists"}