aboutsummaryrefslogtreecommitdiff
path: root/client/src/util/xor.h
diff options
context:
space:
mode:
authoralpine <[email protected]>2020-06-13 22:27:52 +0200
committeralpine <[email protected]>2020-06-13 22:27:52 +0200
commitbad7b4f2d19f95b278fdcb3056be01cae9af1dbb (patch)
tree5bef91f910a2c03d74df9693a077ee33b2fe7886 /client/src/util/xor.h
parentInitial commit (diff)
downloadloader-bad7b4f2d19f95b278fdcb3056be01cae9af1dbb.tar.xz
loader-bad7b4f2d19f95b278fdcb3056be01cae9af1dbb.zip
Client.
Message encryption. Packet handler. Disconnect event handler.
Diffstat (limited to 'client/src/util/xor.h')
-rw-r--r--client/src/util/xor.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/client/src/util/xor.h b/client/src/util/xor.h
new file mode 100644
index 0000000..1ae1ce2
--- /dev/null
+++ b/client/src/util/xor.h
@@ -0,0 +1,14 @@
+#pragma once
+
+namespace enc {
+constexpr size_t key_num = 50;
+
+char gen_key();
+
+// XOR keys at the beginning of the message for clients
+void encrypt_message(std::string &str);
+
+// XOR keys at the end of the message for server messages
+void decrypt_message(std::string &str);
+
+} // namespace enc \ No newline at end of file