0
0
Cybersecurityknowledge~5 mins

Threat actors and motivations in Cybersecurity - Time & Space Complexity

Choose your learning style9 modes available
Time Complexity: Threat actors and motivations
O(n)
Understanding Time Complexity

We want to understand how the effort of threat actors grows as their targets or goals increase.

How does the time or resources needed change when threat actors face more complex or larger targets?

Scenario Under Consideration

Analyze the time complexity of the following simplified threat actor behavior.


for target in target_list:
    gather_information(target)
    if target is vulnerable:
        exploit(target)
    else:
        move_to_next_target()
    

This code shows a threat actor checking multiple targets one by one, trying to exploit vulnerabilities.

Identify Repeating Operations

Look for repeated actions in the code.

  • Primary operation: Looping through each target in the list.
  • How many times: Once for every target, so as many times as there are targets.
How Execution Grows With Input

As the number of targets grows, the total checks and attempts grow too.

Input Size (n)Approx. Operations
10About 10 checks and attempts
100About 100 checks and attempts
1000About 1000 checks and attempts

Pattern observation: The effort grows directly with the number of targets; doubling targets doubles work.

Final Time Complexity

Time Complexity: O(n)

This means the time or effort grows in a straight line with the number of targets.

Common Mistake

[X] Wrong: "The effort stays the same no matter how many targets there are."

[OK] Correct: Each new target adds more work, so effort increases with more targets.

Interview Connect

Understanding how threat actors scale their efforts helps you think clearly about security risks and defenses.

Self-Check

"What if the threat actor could check multiple targets at the same time? How would the time complexity change?"