π‘οΈ Cyber Security
The bad guys on the Internet, the tricks they use, and every wall, guard, and alarm we've built to keep them out.
4.1Introduction to Cyber Security
Cyber security is the practice of protecting computers, networks, programs, and data from digital attacks, damage, or unauthorized access.
The CIA Triad β the three goals of security
- Confidentiality β only authorized people can see the data. (Passwords, encryption.)
- Integrity β data cannot be changed without detection. (Hashing, checksums.)
- Availability β the system is up when you need it. (Backups, DDoS protection.)
Why cyber security matters
- Protects personal data (photos, messages, bank info).
- Prevents financial losses (fraud, ransomware).
- Keeps critical services running (power grid, hospitals).
- Protects national security.
4.2Common security threats
Social engineering
Hacking humans, not computers. Trick a person into giving up passwords, clicking a bad link, or handing over money.
- Phishing β fake emails/SMS pretending to be a bank, Daraz, "Nepal Police" asking you to click and "verify" your account.
- Vishing β phishing over a phone call.
- Smishing β phishing over SMS.
- Pretexting β attacker pretends to be a colleague / IT support to extract info.
- Baiting β leaves a USB drive in a parking lot; whoever plugs it in gets infected.
Denial of Service (DoS) & Distributed Denial of Service (DDoS)
- DoS β one attacker floods a server with so many requests that it can't serve real users.
- DDoS β same idea, but from thousands of computers at once (often a botnet of infected machines).
Malware (malicious software)
- Virus β attaches itself to a legitimate file, spreads when that file is shared.
- Worm β spreads over a network on its own, no host file needed.
- Trojan horse β pretends to be useful software, hides malicious code.
- Ransomware β encrypts your files and demands money to unlock them.
- Spyware β secretly watches what you do (keylogger, screen grabs).
- Adware β shows forced ads and redirects.
- Rootkit β hides deep in the OS to keep itself invisible.
Other common threats
- Man-in-the-Middle (MITM) β attacker sits between you and the server, reads/changes your traffic.
- SQL Injection β attacker slips database commands into a form field.
- Password attacks β brute force, dictionary attacks, credential stuffing.
- Zero-day β attack on a flaw the vendor hasn't patched yet.
- Insider threat β danger from an employee who misuses their access.
4.3Security Mechanisms
Encryption
Scrambling readable data (plaintext) into unreadable form (ciphertext) using a key. Only someone with the right key can unscramble it.
- Symmetric β same key for encryption + decryption (AES). Fast, but key must be shared securely.
- Asymmetric β public key to encrypt, private key to decrypt (RSA). The basis of HTTPS.
Hashing
A one-way function that turns any input into a fixed-length "fingerprint." Used to check if data was tampered with, and to store passwords safely. Examples: MD5 (old, weak), SHA-1 (weak), SHA-256 (strong).
Digital signatures
Proves who sent a message and that it wasn't changed. Uses the sender's private key to sign a hash of the message.
Backup
Regular copies of data stored separately. The only cure for ransomware. Follow the 3-2-1 rule: 3 copies, on 2 different media, with 1 off-site.
Secure protocols
- HTTPS β encrypted HTTP.
- SSL / TLS β the encryption underneath HTTPS.
- SSH β secure remote login.
- VPN β encrypts all your traffic through a secure tunnel.
4.4Identity and Access Control
The three A's
- Authentication β Who are you? Proving your identity (password, fingerprint, OTP).
- Authorization β What are you allowed to do? Permissions (read/write/admin).
- Accounting / Auditing β What did you do? Logs of every action.
Authentication factors
- Something you know β password, PIN.
- Something you have β OTP SMS, security token, phone.
- Something you are β fingerprint, face, iris (biometrics).
MFA (Multi-Factor Authentication)
Combines two or more of the above. Example: password + OTP = 2FA. Much harder to bypass than a password alone.
Access control models
- DAC (Discretionary) β owner decides who can access.
- MAC (Mandatory) β system enforces fixed rules (military).
- RBAC (Role-Based) β permissions based on role (admin, editor, viewer).
Password best practices
- Long (12+ characters), mix letters/numbers/symbols.
- Different password for every site.
- Use a password manager.
- Enable MFA wherever possible.
4.5Firewalls, IDS, and IPS
Firewall
A firewall is a security system that monitors and controls incoming and outgoing network traffic based on rules. It sits between your network and the Internet.
- Hardware firewall β a physical device (often built into your router).
- Software firewall β runs on your computer (Windows Defender Firewall).
IDS β Intrusion Detection System
Watches network traffic and alerts you when it sees suspicious activity. Does not block β just sounds the alarm.
IPS β Intrusion Prevention System
Like IDS, but actively blocks the bad traffic. IDS = alarm; IPS = alarm + auto-lockdown.
| System | What it does | Analogy |
|---|---|---|
| Firewall | Allows/blocks traffic by rules | Mall guard checking IDs |
| IDS | Detects and alerts | CCTV with a watchman who shouts |
| IPS | Detects and blocks automatically | CCTV that also locks the gate |
4.6Email Filtering
Email filtering is the process of sorting incoming email into legitimate, spam, and malicious categories β automatically.
What filters look at
- Sender reputation (is this domain known for spam?)
- Content (suspicious words like "FREE LOTTERY WINNER!!!").
- Attachments (.exe files, weird extensions).
- Links (do they go to known phishing sites?).
- Authentication records: SPF, DKIM, DMARC β check if the sender is really who they claim to be.
Where filtered mail goes
- Inbox β passed all checks.
- Spam / Junk folder β suspicious; check before deleting.
- Quarantine β likely malicious; admin must release.
- Blocked β rejected entirely.
4.7Use of Antivirus Software
Antivirus software detects, prevents, and removes malware from a computer.
How antivirus works
- Signature-based detection β matches files against a database of known malware "fingerprints."
- Heuristic analysis β looks for suspicious behavior, even for never-seen malware.
- Real-time scanning β checks every file as it's opened.
- Scheduled scans β scans the whole disk on a schedule.
- Quarantine β isolates infected files so they can't run.
Popular antivirus programs
- Windows Defender (built into Windows 10/11).
- Kaspersky.
- Bitdefender.
- Norton.
- Avast / AVG.
- Quick Heal.
- McAfee.
Safe-computing habits (just as important as antivirus)
- Keep OS and apps updated.
- Don't install software from random websites.
- Don't click unknown links or download unknown attachments.
- Use strong unique passwords + MFA.
- Take regular backups.
Ready for MCQs?
Gemini will write 10 fresh questions from this chapter's syllabus. Hit "Generate more" for another round.
Back to Home