Learning Objectives
By the end of this chapter, you will be able to:
- Define network security and list common network security measures.
- Describe the function and types of firewalls, including hardware and software firewalls.
- Define encryption and decryption, and distinguish symmetric from asymmetric encryption.
- Explain how HTTPS, digital signatures, and VPNs use encryption.
Network Security
Network security consists of the policies and practices adopted to prevent and monitor unauthorized access, misuse, modification, or denial of a computer network and network-accessible resources.
Common network security measures
- Firewalls — filter traffic entering and leaving a network.
- Encryption — makes intercepted data unreadable.
- Strong authentication — passwords plus multi-factor authentication (OTP, authenticator app).
- Antivirus and anti-malware — detect and remove malicious software.
- Intrusion Detection/Prevention Systems (IDS/IPS) — watch for attack patterns and raise alerts or block them.
- VPNs — create encrypted tunnels for remote staff.
- Regular patching — closes known security holes.
Firewalls
A firewall is a network security device that monitors incoming and outgoing network traffic and decides whether to allow or block specific traffic based on a defined set of security rules. A firewall acts as a barrier between a trusted internal network and an untrusted external network, such as the internet.
flowchart LR
NET[Internet: untrusted] --> FW{Firewall rules}
FW -->|Allowed: web traffic to the company website| LAN[Internal network: trusted]
FW -->|Blocked: unknown remote login attempt| X[Dropped]
Hardware vs software firewalls
| Aspect | Hardware firewall | Software firewall |
|---|---|---|
| Form | Separate device or built into the router | Program installed on each computer |
| Protects | The whole network behind it | Only the computer it is installed on |
| Example | Office firewall appliance, home Wi-Fi router | Windows Defender Firewall |
| Best for | Blocking attacks before they reach the network | Controlling which apps on a PC may use the network |
Most organizations use both: a hardware firewall at the network edge and software firewalls on each device.
Types of firewalls
- Packet-filtering firewall — checks each packet’s source, destination, and port against rules. Fast but basic.
- Stateful inspection firewall — remembers active connections and allows only traffic that belongs to them.
- Proxy (application-level) firewall — sits between users and the internet and inspects the content of requests.
- Next-generation firewall (NGFW) — combines filtering with application awareness and intrusion prevention.
Encryption and Decryption
Encryption is the process of converting plain text into a coded, unreadable format called ciphertext. This is done using an algorithm and a key. Decryption is the process of converting the ciphertext back into plain text, which can only be done with the correct key.
Encryption is the most effective way to protect the confidentiality of data both when it is being stored and when it is being transmitted over a network.
Worked example: a Caesar cipher
The Caesar cipher shifts each letter by a fixed number. With a key of 3:
- Plain text:
HELLO - Encryption (shift each letter forward by 3):
KHOOR - Decryption (shift back by 3):
HELLO
Modern algorithms such as AES are far more complex, but the idea is the same: without the key, the message cannot be read.
Symmetric vs asymmetric encryption
| Aspect | Symmetric (secret-key) | Asymmetric (public-key) |
|---|---|---|
| Keys | One shared secret key encrypts and decrypts | A public key encrypts; a matching private key decrypts |
| Speed | Fast; good for large data | Slower; used for small data and key exchange |
| Challenge | Sharing the secret key safely | Managing and trusting public keys |
| Examples | AES | RSA |
Encryption in everyday use
- HTTPS — the padlock in the browser means data between you and the website is encrypted using TLS. Online banking, eSewa, and shopping sites rely on it.
- Digital signatures — the sender signs with a private key; anyone can verify with the public key, proving who sent the message and that it was not changed.
- VPN (Virtual Private Network) — creates an encrypted tunnel so remote employees can use the office network safely over public Wi-Fi.
- Encrypted messaging — apps such as WhatsApp use end-to-end encryption so only the sender and receiver can read messages.
Business Scenario
A cooperative in Chitwan lets staff access its accounting server from branches. Without protection, anyone on the internet could try to log in. The IT officer installs a hardware firewall that allows only branch traffic, requires a VPN for remote access, turns on HTTPS for the web portal, and enables multi-factor authentication. Even if a staff password is stolen, the attacker still cannot get in.
Summary
Network security is essential for protecting data and systems from attack. Two of the most fundamental security tools are firewalls and encryption. A firewall—hardware or software, packet-filtering to next-generation—acts as a barrier, filtering network traffic to block malicious activity. Encryption scrambles data so that it can only be read by authorized parties: symmetric encryption uses one shared key, while asymmetric encryption uses a public–private key pair. HTTPS, digital signatures, and VPNs all apply encryption to protect information as it travels across networks.
Key Takeaways
- Network security aims to prevent unauthorized access and misuse of a network.
- A firewall is a barrier that filters network traffic based on security rules; hardware firewalls protect networks, software firewalls protect individual devices.
- Encryption scrambles data to make it unreadable; decryption unscrambles it with the correct key.
- Symmetric encryption uses one key; asymmetric encryption uses a public and a private key.
- HTTPS, digital signatures, and VPNs are everyday uses of encryption.
Discussion Questions
- Using an analogy, explain the function of a firewall.
- Why is encryption so important for online activities like banking and shopping?
- Where is the firewall that protects your home computer likely located?
Exam-Style Questions
Short answer
- What is a firewall? Differentiate between hardware and software firewalls.
- Define encryption and decryption with an example.
- Differentiate between symmetric and asymmetric encryption.
Long answer
- Explain the types of firewalls and how they protect an organization’s network.
- What is cryptography? Explain how encryption is used to secure online banking and e-commerce transactions.

