6
1
mirror of https://git.mills.io/saltyim/saltyim.git synced 2024-06-28 09:41:02 +00:00
saltyim is the Go library and reference client and broker implementation for Salty IM it contains a command-line client (cli), a terminal user interface (tui), builtin server/broker and a Mobile / Desktop App PWA (progressive web app)
Go to file
James Mills ddd16c202f Add blob service and support for signing and verifying HTTP requests (#178)
Alternative to #177

The way this works is:

Client:

- Client creates a normal `net/http.Request{}` object using the `Request()` function in `utils.go`. The `http.Request{}` object is then signed using the Client's Ed25519 private key.
- The HTTP Method and Path (_note this is important_) are hashed, as well as the request body (if any) using the FNV128a hashing algorithm.
- This hash is then signed by the Client's's Ed25519 private key.
- The resulting signature is then encoded to Base64 (_standard encoding_) and added to the HTTP headers as a `Signature:` header.
- In addition the Client's Ed25519 public key is added to the HTTP headers as `Signer:`

Server:

- The server calculates the same FNV128a hash of the HTTP Request Method and Path and the body (if any)
- The server decodes the HTTP header `Signature:`
- The server then uses the Client's Ed25519 public key in the HTTP header `Signer:` to verify the signature of the `Signature:` HTTP header which gives us back the original FNV128a hash the Client calculated for the request.
- The server then compares the Client's hash with the expected hash to see if they compare equally.

Co-authored-by: James Mills <1290234+prologic@users.noreply.github.com>
Co-authored-by: Jon Lundy <jon@xuu.cc>
Reviewed-on: https://git.mills.io/saltyim/saltyim/pulls/178
Reviewed-by: xuu <xuu@noreply@mills.io>
2023-01-25 23:05:29 +00:00
.chglog Add chglog config 2022-03-20 00:49:56 +10:00
.dockerfiles Tidy up the Docker image's entrypoint 2022-03-27 00:58:28 +10:00
bin Make the service bot actually work finally (#73) 2022-03-27 05:25:09 +00:00
certs Add clean-all target to Makefile 2022-03-28 11:08:19 -06:00
cmd Add blob service and support for signing and verifying HTTP requests (#178) 2023-01-25 23:05:29 +00:00
data Add blob service and support for signing and verifying HTTP requests (#178) 2023-01-25 23:05:29 +00:00
docs Add blob service and support for signing and verifying HTTP requests (#178) 2023-01-25 23:05:29 +00:00
hooks support for contacts, multiple chat threads, and persistence (#77) 2022-03-28 21:49:01 +00:00
internal Add blob service and support for signing and verifying HTTP requests (#178) 2023-01-25 23:05:29 +00:00
tools Add lookup command (#4) 2022-03-18 14:48:59 +00:00
.drone.yml Add Avatar service and cli for updating avatar on a broker (#116) 2022-04-02 02:59:39 +00:00
.gitattributes Add clean-all target to Makefile 2022-03-28 11:08:19 -06:00
.gitignore Add blob service and support for signing and verifying HTTP requests (#178) 2023-01-25 23:05:29 +00:00
.goreleaser.yml Fix goreleaser config 2022-05-02 12:24:32 +10:00
Caddyfile feat: add compression negotiation for sent messages (#91) 2022-03-29 22:23:16 +00:00
CHANGELOG.md Update CHANGELOG for 0.0.22 2022-05-14 01:01:00 +10:00
client_test.go Add blob service and support for signing and verifying HTTP requests (#178) 2023-01-25 23:05:29 +00:00
client.go Add blob service and support for signing and verifying HTTP requests (#178) 2023-01-25 23:05:29 +00:00
Corefile Add Avatar service and cli for updating avatar on a broker (#116) 2022-04-02 02:59:39 +00:00
db.home.arpa Add Avatar service and cli for updating avatar on a broker (#116) 2022-04-02 02:59:39 +00:00
doc.go Add package level docs 2023-01-14 12:48:22 +10:00
Dockerfile Fix Dockerfile and add internal/pwas/utils (#100) 2022-03-31 00:58:09 +00:00
example-config.yml feat: make endpoint uniform. add profiles (#30) 2022-03-21 00:31:59 +00:00
format_test.go Add unit tests (#55) 2022-03-25 01:52:59 +00:00
format.go Add doc strings for all the thigns 2023-01-14 12:46:47 +10:00
go.mod Add blob service and support for signing and verifying HTTP requests (#178) 2023-01-25 23:05:29 +00:00
go.sum Add blob service and support for signing and verifying HTTP requests (#178) 2023-01-25 23:05:29 +00:00
identity_test.go Adds support for multiple chats (#174) 2023-01-11 22:58:07 +00:00
identity.go Add blob service and support for signing and verifying HTTP requests (#178) 2023-01-25 23:05:29 +00:00
LICENSE Fix README (Fixes #74) 2022-09-25 12:52:51 +10:00
lookup_test.go Add unit tests (#55) 2022-03-25 01:52:59 +00:00
lookup.go Add doc strings for all the thigns 2023-01-14 12:46:47 +10:00
Makefile Add an improved version string contianing the commit timestamp 2023-01-14 10:27:14 +10:00
OLDREADME.md Update 'OLDREADME.md' 2022-03-23 00:18:30 +00:00
options.go Add blob service and support for signing and verifying HTTP requests (#178) 2023-01-25 23:05:29 +00:00
preflight.sh feat: hax for great justice (#14) 2022-03-19 21:33:03 +00:00
README.md Fix README logo by centering it 2022-09-25 13:00:55 +10:00
resolv.go Add doc strings for all the thigns 2023-01-14 12:46:47 +10:00
Roadmap.md Update 'Roadmap.md' 2022-03-25 21:38:44 +00:00
send.go Add doc strings for all the thigns 2023-01-14 12:46:47 +10:00
service.go Add blob service and support for signing and verifying HTTP requests (#178) 2023-01-25 23:05:29 +00:00
state.go Add doc strings for all the thigns 2023-01-14 12:46:47 +10:00
types.go Add blob service and support for signing and verifying HTTP requests (#178) 2023-01-25 23:05:29 +00:00
utils_test.go Add unit tests (#55) 2022-03-25 01:52:59 +00:00
utils.go Add blob service and support for signing and verifying HTTP requests (#178) 2023-01-25 23:05:29 +00:00
version.go Fix version output when no version is injected (i.e: go install) 2023-01-14 10:38:53 +10:00

Salty IM -- secure, easy, self-hosted messaging

Build Status Go Report Card Go Reference

SaltyIM Logo

Salty IM is a secure, decentrlaised and easy self-hosted instant messaging alternative. Salty IM is fully encrypted using the salty Go library utilising the Saltypack messaging format and parts of keys.pub implemtnation for its cryptography. Encryption, Decryption and Signing of messages is performed with public key cryptography using the Ed25519 algoritms.

For more information on how the protocol works, please refer to the Specification.

This repository also contains a reference client (written in Go), a reference broker (server) as well as a Terminal TUI (TUI) client called salty-chat and command-line tools:

  • saltyd -- Reference broker (server)
  • salty-chat -- Command-line tools and Terminal UI (TUI)
  • saltyim -- Reference client (Go library)

Quick Start CLI

$ go install go.mills.io/saltyim/cmd/salty-chat@latest
$ salty-chat make-user user@domain
# Follow the insturctions
$ salty-chat chat prologic@mills.io

Alternatively follow the full documentation below to setup your own Salty broker and your domain name.

Quick Start (DEV)

Documentation

See also the Old Readme for how this implementation started out as a simple shell script which you can still find at salty-chat.sh.

Roadmap

Please refer to the Roadmap document.

License

saltyd and salty-chat are licensed under the terms of the MIT license.