From 2df8de0a3e71f6ebb0b953213c4be1c8edcbe39a Mon Sep 17 00:00:00 2001 From: Rusty Striker Date: Sun, 1 Dec 2024 19:40:08 +0200 Subject: [PATCH] some readme-s --- README.md | 11 +++++++++++ client/README.md | 2 ++ lib/README.md | 6 ++++++ protocol.md | 29 +++++++++++++++++++++++++++++ protocol.typ | 0 server/README.md | 1 + 6 files changed, 49 insertions(+) create mode 100644 README.md create mode 100644 client/README.md create mode 100644 lib/README.md create mode 100644 protocol.md delete mode 100644 protocol.typ create mode 100644 server/README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..689eedf --- /dev/null +++ b/README.md @@ -0,0 +1,11 @@ +# Project - TODO: + +[ ] Create a skeleton protocol +[ ] implement most of the skeleton + [ ] Create basic TCP server + [ ] Create basic client that connects to the server + [ ] Send ping message from client to server + [ ] Add more items based on skeleton protocol +[ ] Refine protocol using the implementation (and update stuff that got changed in impl) +[ ] Finish implementing the protocol +[ ] Update the protocol file with the latest structs and stuff diff --git a/client/README.md b/client/README.md new file mode 100644 index 0000000..666cadb --- /dev/null +++ b/client/README.md @@ -0,0 +1,2 @@ +# Client + diff --git a/lib/README.md b/lib/README.md new file mode 100644 index 0000000..c743235 --- /dev/null +++ b/lib/README.md @@ -0,0 +1,6 @@ +# Shared library + +Contains shared stuff between the client and the server: + +- Data structures +- helper functions diff --git a/protocol.md b/protocol.md new file mode 100644 index 0000000..f999141 --- /dev/null +++ b/protocol.md @@ -0,0 +1,29 @@ +# The Protocol + +All encryptions are made using RSA (key size to be determined), no symmetric encryptions +are used due to messages being short. + +## Registration: + +- User sends a register request to server `(phone number, RSA public key)`, +giving them a public key and encrypting using the server's public key +- Server sends the user a `Confirm` message & a 6-digit code +- User sends the server the 6-digit code, signed using the key provided at stage 1 +(this message is very short and funny, because its a 6-digit code, signed using the +user's private key, and encrypted using the server's public key) +- Server sends a last `Confirm` and the registration process is done + +## "Login" + +The users dont need to login, as they dont really need to hold a conenction +to the server, only thing that matters is that every message to the server should +be signed with the user's private key, thus the key acts as a form of credentials + +## Passing messages + +In order to send a message from A to B, A will ask the server for B's key, +A will then encrypt the message using B's key, signed with A, wrapped in a `SendMessage` +request and ultimately signed by A and encrypted using the server's key. + +The server will hold on to the message until B will send a `GetMessages` request +to the server. diff --git a/protocol.typ b/protocol.typ deleted file mode 100644 index e69de29..0000000 diff --git a/server/README.md b/server/README.md new file mode 100644 index 0000000..76ac08d --- /dev/null +++ b/server/README.md @@ -0,0 +1 @@ +# Server