diff --git a/KeyMaster b/KeyMaster index a710a6b..047f1bc 100755 Binary files a/KeyMaster and b/KeyMaster differ diff --git a/bin/KeyMaster b/bin/KeyMaster index a710a6b..047f1bc 100755 Binary files a/bin/KeyMaster and b/bin/KeyMaster differ diff --git a/include/dynmem.c b/include/dynmem.c index da693d1..43255df 100644 --- a/include/dynmem.c +++ b/include/dynmem.c @@ -66,11 +66,13 @@ void writel(const char *filepath, void *buffer, size_t size) #endif } -void emcryptText(int *output, char *password) +void encryptText(int *output, char *password) { for (int i = 0; i < 256; i++) { - output[i] = (int)password[i] * 2; + output[i] = (int)password[i]; + output[i] ^= 0xFF; // Invert bitwise all characters in the password + output[i] = output[i] * 2; } } @@ -78,6 +80,7 @@ void decryptText(char *output, int *password) { for (int i = 0; i < 256; i++) { - output[i] = (char)(password[i] / 2); + int temp = password[i] / 2; + output[i] = (char)(temp ^ 0xFF); // Reverse the XOR and division operations } } diff --git a/include/dynmem.h b/include/dynmem.h index 755e3fb..c1770c1 100644 --- a/include/dynmem.h +++ b/include/dynmem.h @@ -55,7 +55,7 @@ int readl(const char *filepath, void *buffer, size_t size); //@param filepath Path to the file @param buffer Buffer to store the file @param size Size parameter specifies the number of bytes to read void writel(const char *filepath, void *buffer, size_t size); //@param filepath Path to the file @param buffer Buffer to write to the file @param size Size parameter specifies the number of bytes to write -void emcryptText(int *output, char *password); //@param output Output buffer to store the encrypted text @param password Password to encrypt the text +void encryptText(int *output, char *password); //@param output Output buffer to store the encrypted text @param password Password to encrypt the text void decryptText(char *output, int *password); //@param output Output buffer to store the decrypted text @param password Password to decrypt the text diff --git a/src/main.c b/src/main.c index 7ed8545..c185b96 100644 --- a/src/main.c +++ b/src/main.c @@ -32,6 +32,7 @@ void clear_input_buffer(void) int main(void) { + char *password = create(char); password = size(password, 256); @@ -59,7 +60,7 @@ int main(void) int *buffer = create(int); buffer = size(buffer, 256); - emcryptText(buffer, password); + encryptText(buffer, password); writel(PASS_FILE, buffer, 256); free(buffer); @@ -169,8 +170,11 @@ int main(void) printf("\nList of existing passwords:\n<------->\n"); Request req; - // send request with type 4 to get IDs for all passwords - req.type = 4; + // send request with type 3 to get IDs for all passwords + // level == how many keys are being sent + // key == the list of levels that have keys + + req.type = 3; memset(&req.key, 0, sizeof(req.key)); req.ID = 1; req.level = 0;