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