Refractoring of lots of code, JSON usage for cross-platform and better encryption
In summary, I changed the encryption and LightReader API will become it's own repository with PiAnimation along side. The new network method for sending and receiving messages is now using JSON which is encrypted in AES 128 bit (might change to 256 soon) and this allows for the possibility for it to work on other platforms like Flutter (Dart) C# or other clients. Though this new way of sending messages requires an update for both client and server, no backwards compatibility.
I might switch the GSON Json parses to a faster and more reliable one if it causes a marginal improvement.
I spent hours on end trying to get encryption working the way it was designed to work while also allowing JSON to be a possibility. I'm quite proud of the result, enjoy!
Changelog:
- Did a lot refractoring of code
- Uses JSON (with encryption) while wrapping around an unencrypted JSON block
- Uses RSA for handshake encryption
- While messing with code, I saw the old encryption method was redundant because the key was given in plain text. This was fixed while also using JSON for sending packets. The packets are now wrapped around a JSON packet wrapper that converts the object into it's own JSON object.
- Attempted to lower some latency with more async code
- Added some changes to the LightReader API which is planned to become it's own github repo soon. (And so will PiAnimation)
- The LightReader API uses annotations for defining it's command name and required arguments.