HTTPS and security in SEO Fundamentals - Time & Space Complexity
When we use HTTPS, the browser and server do extra work to keep data safe.
We want to understand how this extra work grows as more users connect or more data is sent.
Analyze the time complexity of HTTPS handshake and data encryption steps.
// Simplified HTTPS process
function httpsRequest(data) {
performTLSHandshake(); // secure connection setup
const encryptedData = encryptData(data); // encrypt data
sendData(encryptedData); // send encrypted data
receiveResponse(); // get server reply
}
This code shows the main steps HTTPS takes to secure data before sending it.
Look for repeated actions that affect time.
- Primary operation: Encrypting the data before sending.
- How many times: Once per request, but encryption work depends on data size.
As the amount of data grows, the encryption work grows too.
| Input Size (n) | Approx. Operations |
|---|---|
| 10 bytes | Small encryption work |
| 100 bytes | About 10 times more encryption work |
| 1000 bytes | About 100 times more encryption work |
Pattern observation: Encryption time grows roughly in direct proportion to data size.
Time Complexity: O(n)
This means the time to encrypt and send data grows linearly with how much data you have.
[X] Wrong: "HTTPS slows down everything equally, no matter data size."
[OK] Correct: The main delay depends on data size; small data encrypts quickly, large data takes longer.
Understanding how HTTPS work time grows helps you explain real-world web performance and security trade-offs clearly.
What if we changed from encrypting all data to encrypting only parts of it? How would the time complexity change?