diff --git a/Keypairs.md b/Keypairs.md new file mode 100644 index 0000000..9a3b83b --- /dev/null +++ b/Keypairs.md @@ -0,0 +1,32 @@ +Each build of Laika (cnc, bot && shell) is tied to a 'central keypair.' This keypair is used by the cnc server to authenticate themselves with each bot. The keypair is defined as a macro in `lib/include/lconfig.h.in`. + +## Generating keypairs + +[After compiling the target](Compiling), an output binary called `genKey` will be produced. This is a simple wrapper for libsodium to generate [keypairs](https://doc.libsodium.org/key_exchange/). + +```sh +$ ./bin/genKey +``` +> Note: on windows, genKey will be located in `winbin` + +You should receive output that looks like: + +``` +[~] Generated keypair! +[~] public key: 40d5534aca77d1f5ec2bbe79dd9d0f52a78148918f95814404cefe97c34c5c27 +[~] private key: 90305aa77023d1c1e03265c3b6af046eb58d6ec8ba650b0dffed01379feab8cc +``` + +## Passing keypairs back to Laika + +Now that you have your central keypair, delete the build and output directories. + +```sh +$ rm -rf bin build +``` + +Now re-build Laika, but passing your keypair + +```sh +$ cmake -B build -DLAIKA_PUBKEY="40d5534aca77d1f5ec2bbe79dd9d0f52a78148918f95814404cefe97c34c5c27" -DLAIKA_PRIVKEY="90305aa77023d1c1e03265c3b6af046eb58d6ec8ba650b0dffed01379feab8cc" && cmake --build build +``` \ No newline at end of file