Package Layer
The Package Layer is responsible for the encryption, compression, and wire format of the packets. It is what is responsible for taking the data from the higher layers (applications) and turning it into a format that can be sent to the transport layer.
The goal of the Package Layer is to provide a clean API/SDK for the higher layers to use to build and read packets. It should be able to handle all the complexities of encryption (including automatically exchanging and storing keys), compression, and wire format. This layer should be able to take fully formed messages from either the application layer or the transport layer and turn them into a format the other can use.
📄️ Packet Structure
Our custom protocol is a shared packet structure for all %%mediums%%. This allows reusability for any current and future mediums we wish to support without needing to re-invent the structure each time. Additionally, because our packet structure is build on top of %%Protocol Buffers (Protobufs)|Protocol_Buffers%%, we get the benefits it brings. These include:
📄️ Encryption Format
%%Encryption%% is a very difficult thing to get right. We won't go into the depths of why, but in any %%cryptography%% course one of the first rules they drill into your head is "don't roll your own crypto." See this StackExchange post for more information.