diff options
| author | daniel <daniel@planethacker.net> | 2025-05-07 09:45:50 -0700 |
|---|---|---|
| committer | daniel <daniel@planethacker.net> | 2025-05-07 09:45:50 -0700 |
| commit | eeac69b2168c5a65f9608771006ccc43033cbd23 (patch) | |
| tree | 1dc44a6016b607085a691768810d551045df9901 /cstrobf.c | |
Diffstat (limited to 'cstrobf.c')
| -rw-r--r-- | cstrobf.c | 27 |
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); +} |
