Time Complexity: Why secure design prevents vulnerabilities
O(n)
We want to understand how the effort to find and fix security problems grows as a system gets bigger or more complex.
How does designing security from the start affect the work needed to keep a system safe?
Analyze the time complexity of the following security check process.
function checkInput(inputList) {
for (let input of inputList) {
if (!isValid(input)) {
logError(input);
alertAdmin(input);
}
}
}
function isValid(input) {
// simple validation rules
return input.length > 0 && !input.includes("