Network security protects data in transit and the systems behind it. The core ideas are encryption (keeping data confidential), authentication (proving identity), and defending against common attacks. You don't need to be a security engineer, but knowing symmetric vs asymmetric encryption and how HTTPS works is expected.
Symmetric vs asymmetric encryption
Symmetric encryption uses one shared secret key for both encrypt and decrypt — fast, but the key must be shared safely. Asymmetric uses a public/private key pair — anyone encrypts with your public key, only you decrypt with your private key — slower, but solves key distribution.
The CIA triad
- Confidentiality — only authorised parties can read the data (encryption).
- Integrity — data isn't tampered with (hashes, checksums, signatures).
- Availability — systems stay accessible (defending against DoS).
⚡ The edge
- HTTPS combines both: it uses asymmetric encryption during the handshake to safely exchange a symmetric session key, then uses the fast symmetric key for the actual data. Best of both worlds.
- Hashing is one-way (you can't reverse it) — it's for integrity and password storage, not encryption. Encryption is reversible with a key.
Worked example
'What is the difference between symmetric and asymmetric encryption?'
- Symmetric uses one shared key for both encryption and decryption — fast, but you must distribute the key securely.
- Asymmetric uses a public key to encrypt and a private key to decrypt — it solves key distribution but is slower.
- In practice, systems like HTTPS use asymmetric to exchange a symmetric key, then symmetric for speed.
Answer: Symmetric = one shared key (fast); asymmetric = public/private pair (solves key sharing, slower).
Worked example
'How does HTTPS keep a connection secure?'
- During the TLS handshake, the server presents a certificate proving its identity (authentication).
- Asymmetric keys are used to agree on a shared symmetric session key without exposing it.
- All further data is encrypted with that symmetric key, ensuring confidentiality and integrity.
Answer: TLS authenticates the server, exchanges a symmetric key via asymmetric crypto, then encrypts the data.
⚠ Watch out
- Hashing ≠ encryption: hashing is one-way (integrity/passwords); encryption is reversible with a key.
- Symmetric is fast but has a key-distribution problem; asymmetric solves distribution but is slow — that's why HTTPS uses both.
- HTTPS encrypts the data in transit; it does not protect data once stored on the server.