diff --git a/bin/3_n_a_xor_encryption b/bin/3_n_a_xor_encryption index 071fe97..ce9114b 100755 Binary files a/bin/3_n_a_xor_encryption and b/bin/3_n_a_xor_encryption differ diff --git a/bin/3_n_b_scalarm b/bin/3_n_b_scalarm index f388925..0cd595e 100755 Binary files a/bin/3_n_b_scalarm and b/bin/3_n_b_scalarm differ diff --git a/bin/3_n_c_userdb b/bin/3_n_c_userdb index e197d2c..71a285e 100755 Binary files a/bin/3_n_c_userdb and b/bin/3_n_c_userdb differ diff --git a/bin/3_p_a_zaehlen b/bin/3_p_a_zaehlen index 5728014..400ca21 100755 Binary files a/bin/3_p_a_zaehlen and b/bin/3_p_a_zaehlen differ diff --git a/bin/3_p_b_transponieren b/bin/3_p_b_transponieren index e2efbc7..145c170 100755 Binary files a/bin/3_p_b_transponieren and b/bin/3_p_b_transponieren differ diff --git a/bin/3_p_c_parteien b/bin/3_p_c_parteien index f05abc8..85bb260 100755 Binary files a/bin/3_p_c_parteien and b/bin/3_p_c_parteien differ diff --git a/src/3_n_a_xor_encryption.c b/src/3_n_a_xor_encryption.c index bcc845e..5b5f5c0 100644 --- a/src/3_n_a_xor_encryption.c +++ b/src/3_n_a_xor_encryption.c @@ -1 +1 @@ -#include #include #define MAX_LENGTH 31 // 30 characters + '\0' termination #define SALT 15 int main() { char input[MAX_LENGTH]; int offset = 0; char character; // prompt for input printf("Please enter message: "); while (offset + 1 < MAX_LENGTH && (character = getchar()) != '\n') { input[offset++] = character; } input[offset] = '\0'; // encrypt message for (offset = 0; offset < strlen(input); offset++) { input[offset] ^= SALT; } printf("Encrypted message: %s\n", input); // decrypt message for (offset = 0; offset < strlen(input); offset++) { input[offset] ^= SALT; } printf("Decrypted message: %s\n", input); return 0; } \ No newline at end of file +#include #include #define MAX_LENGTH 31 /* 30 characters + '\0' termination */ #define SALT 15 int main() { char input[MAX_LENGTH]; int offset = 0; char character; /* prompt for input */ printf("Please enter message: "); while (offset + 1 < MAX_LENGTH && (character = getchar()) != '\n') { input[offset++] = character; } input[offset] = '\0'; /* encrypt message */ for (offset = 0; offset < strlen(input); offset++) { input[offset] ^= SALT; } printf("Encrypted message: %s\n", input); /* decrypt message */ for (offset = 0; offset < strlen(input); offset++) { input[offset] ^= SALT; } printf("Decrypted message: %s\n", input); return 0; } \ No newline at end of file diff --git a/src/3_n_c_userdb.c b/src/3_n_c_userdb.c index 23286db..e9139eb 100644 --- a/src/3_n_c_userdb.c +++ b/src/3_n_c_userdb.c @@ -17,7 +17,7 @@ int main() { int count, offset; for (offset = 0, count = 0; offset < MAX_ACCOUNTS; offset++, count++) { - printf("Should this user be activated? (0/1/-1): "); // -1 for break input + printf("Should this user be activated? (0/1/-1): "); /* -1 for break input */ fgets(input_buffer, BUFFER_SIZE, stdin); users[offset].active = atoi(input_buffer); if (users[offset].active == -1) {