BlackBox is a plugin for Mirage to allow encrypting and decrypting of messages.
This does not protect you from any type of MITM attacks. This still requires end users to have there servers behind some type of ssl connection to securely pass around the public key between clients and server. Each time a user connects to the server a new public key is assigned and server matches and creates a shared key with each client. Each new instance of server or even upn reboot will recreate a new private / public key that the server will use to generate a shared key. So if there is a MITM attack its only for that single instance user is connected and or server is not rebooted.
In the future I do plan to add feature to have a ssl connection to pass the key around to protect it fully from MITM attacks. At this time mirage is still in progress towards that goal.
The preferred installation method is Unity Package manager.
If you are using unity 2019.3 or later:
- Open your project in unity
- Install Mirage
- Click on Windows -> Package Manager
- Click on the plus sign on the left and click on "Add package from git URL..."
- enter https://github.com/MirageNet/BlackBox.git?path=/Assets/BlackBox
- Unity will download and install BlackBox
- Make sure .NET 4.X set for compiler level.
- In Unity create a NetworkManager gameobject from the GameObject -> Networking -> NetworkManager.
- Attach BlackboxFactory to same gameobject the network manager is on.
- After this just get reference to the blackboxfactory script and call BlackBoxServer.Send or BlackBoxClient.Send to send encrypted messages from server side or client side.
- Attach BlackboxAuthenticator to same object as network manager is attached to. After that everything will link on its own.
- In inspector or in code change the username / password to authenticate user's using encryption method. At this time server just accepts all authentication. if you want to change that please inherit from BlackboxAuthenticator and override the method OnMessageResponse to take control checking on server if username / password is correct.
There are several ways to contribute to this project:
- Pull requests for bug fixes and features are always appreciated.
- Pull requests to improve the documentation is also welcome
- Make tutorials on how to use this
- Test it and open issues
- Review existing pull requests
- Donations
When contributing code, please keep these things in mind:
- KISS principle. Everything needs to be as simple as possible.
- An API is like a joke, if you have to explain it is not a good one. Do not require people to read the documentation if you can avoid it.
- Follow C# code conventions.
- Follow SOLID principles as much as possible.
- Keep your pull requests small and obvious, if a PR can be split into several small ones, do so.