summaryrefslogtreecommitdiff
path: root/cstrobf.c
diff options
context:
space:
mode:
Diffstat (limited to 'cstrobf.c')
-rw-r--r--cstrobf.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/cstrobf.c b/cstrobf.c
new file mode 100644
index 0000000..743285d
--- /dev/null
+++ b/cstrobf.c
@@ -0,0 +1,27 @@
+/*
+ * LOKI3
+ *
+ * [ cstrobf.c ]
+ *
+ * 2019 and beyond Elective Surgery [dmfr]
+ */
+
+#include "cstrobf.h"
+
+
+char *decrypt(estring encrypted) {
+ int i;
+ char buf[CSTROBF_MAX] = {0};
+
+ for (i = 0; i < encrypted.size; i++)
+ buf[i] = encrypted.str[i] ^ encrypted.key[i % encrypted.ksize];
+
+ return strdup(buf);
+}
+
+
+void destroy(char *buf, size_t len) {
+ for(int i = 0; i < len; i++)
+ buf[i] = rand() % 256;
+ free(buf);
+}