cybersecurity · intermediate · ~15 min · safe pentest lab
Practise in-place string editing without leaking original data.
Implement void redact_secrets(char *line) that replaces, in place:
password= (until space or end of line) with ***.token= (until space or end) with ***.A line like user=alice password=hunter2 token=abc123 becomes user=alice password=*** token=***. The buffer is large enough to hold the result without growing.
#include <string.h>
void redact_secrets(char *line) {
/* TODO */
}
Solve this exercise in the browser editor — compile and run against the test harness, no setup required.