ЁЯФм
ЁЯзм
ЁЯФн
ЁЯкР
ЁЯзк
тЖР Back to Dashboard
Font Size:

1. Introduction

As more of our lives move online, protecting data and computer systems has become as important as building them. Cyber security is the practice of defending computers, servers, networks and data from malicious attacks, unauthorised access and damage. A single stolen password, a breached bank account or a ransomware-encrypted hard disk can cause enormous financial and personal harm, which is why every computer science student must understand the threats and the defences.

The threats come from many directions. Malware such as viruses, worms and trojans can infect systems; hackers use techniques like phishing and social engineering to trick people into revealing secrets; and attackers can intercept or tamper with data as it travels across networks. Defending against these threats requires a layered approach: antivirus software, strong passwords, encryption, authentication, firewalls and good user habits.

This chapter explains the common threats to computer systems, the ethical issues raised by security, and the techniques used to protect data. It covers malware types, hacking and crackers, cyber crimes, protection tools, and the concept of IT Act and cyber law. Security questions in the board examination ask for definitions of terms like phishing, firewall, firewall's purpose, encryption vs decryption, and identifying the appropriate security measure for a scenario.

2. Computer Threats and Attacks

A threat is any circumstance or event that can cause harm to a computer system or data. Threats may come from inside the organisation or from outside, and they may be accidental or deliberate. Common threats include malware infection, unauthorised access to data, data theft, denial of service, hardware or network failure, and human error such as losing a USB drive or revealing a password.

2.1 Malware

Malware (malicious software) is software designed to damage, disrupt or gain unauthorised access to a computer system. The main categories are:

def classify_malware(name):
    if name == "virus":
        return "self-replicates with host file, needs user action"
    elif name == "worm":
        return "self-replicates across network automatically"
    elif name == "trojan":
        return "disguised program creating a backdoor"
    elif name == "ransomware":
        return "encrypts files and demands payment"
    else:
        return "unknown malware"

3. Hackers, Crackers and Cyber Crime

A hacker is a person skilled in computers who explores systems; the term is often used for those who break into systems for ethical or malicious reasons. White hat hackers work ethically, finding vulnerabilities with permission to improve security. Black hat hackers (crackers) break into systems illegally for personal gain. Grey hat hackers act between the two, sometimes finding flaws without authorisation but without malicious intent.

Cyber crime refers to illegal activities committed using computers or networks. Examples include hacking (unauthorised access), phishing (fraudulent emails that trick users into revealing passwords), identity theft (stealing someone's personal information), cyber stalking, data theft, and spreading malware. The Information Technology (IT) Act, 2000 of India and its amendments provide the legal framework to prosecute such offences.

4. Social Engineering and Phishing

Social engineering is the manipulation of people into performing actions or divulging confidential information. Attackers exploit human trust rather than technical flaws. Phishing is the most common form: fake emails or websites that impersonate trusted organisations (banks, government portals) and lure victims into entering usernames, passwords or card numbers on fraudulent pages.

Pharming redirects a user from a legitimate website to a fake one, often by poisoning DNS records, so even typing the correct address leads to a malicious site. Defence against social engineering lies mostly in awareness: never click suspicious links, verify senders, and never share passwords.

5. Denial of Service and Other Attacks

A Denial of Service (DoS) attack floods a server with huge volumes of traffic so that it becomes too slow or crashes, denying service to legitimate users. A Distributed DoS (DDoS) attack uses many compromised machines (a botnet) to launch the flood simultaneously, making it harder to block. Other attacks include spoofing (faking an IP or email identity), man-in-the-middle attacks that intercept communication, and SQL injection, where attackers inject malicious SQL into input fields to manipulate databases.

-- A naive query vulnerable to SQL injection
SELECT * FROM users WHERE user_id = '101 OR 1=1';

6. Protection Measures

Protection is layered across people, processes and technology.

def simple_caesar(text, shift):
    result = ""
    for ch in text:
        if ch.isalpha():
            base = ord('a') if ch.islower() else ord('A')
            result += chr((ord(ch) - base + shift) % 26 + base)
        else:
            result += ch
    return result

plain = "HELLO"
cipher = simple_caesar(plain, 3)
print("Encrypted:", cipher)          # KHOOR
print("Decrypted:", simple_caesar(cipher, -3))  # HELLO

7. Digital Signature and Authentication

Authentication verifies that a user is who they claim to be, using something you know (password), something you have (smart card, OTP) or something you are (biometrics). A digital signature is an electronic equivalent of a handwritten signature, created by encrypting a hash of the message with the sender's private key. It provides authenticity, integrity (message not altered) and non-repudiation (sender cannot deny sending). Digital signatures and encryption together use the concept of public and private keys (asymmetric cryptography).

8. Cyber Ethics and Law

Ethical behaviour online matters as much as technical protection. Cyber ethics covers responsible use of computers: respecting privacy, not copying others' work illegally, not spreading false information, and not hacking systems. The IT Act, 2000 is India's primary law dealing with cyber crime and electronic commerce, later amended in 2008 to strengthen provisions against cyber offences.

Quick Revision Tables

Table 1: Types of Malware

Malware How It Spreads Key Characteristic
Virus Attaches to files, needs execution Self-replicates with a host
Worm Network, no host needed Spreads automatically
Trojan Disguised as useful software Creates a backdoor
Spyware Installed secretly Monitors user activity
Ransomware Via infected downloads Encrypts data, demands payment

Table 2: Security Measures

Measure Purpose
Firewall Filters network traffic, blocks unauthorised access
Antivirus Detects and removes malware
Encryption Converts data to unreadable ciphertext
Strong password + MFA Verifies identity
Backups Restore data after loss or attack

Mind Map

flowchart TD A[Security Aspects] --> B[Threats] B --> B1[Malware] B1 --> B2[Virus Worm Trojan Spyware Ransomware] B --> B3[Phishing and social engineering] B --> B4[DoS and DDoS attacks] A --> C[Attackers] C --> C1[White hat ethical hackers] C --> C2[Black hat crackers] A --> D[Protection] D --> D1[Firewall] D --> D2[Antivirus] D --> D3[Encryption and decryption] D --> D4[Strong passwords and MFA] D --> D5[Backups and updates] A --> E[Authentication] E --> E1[Password OTP biometrics] E --> E2[Digital signature] A --> F[Cyber law and ethics] F --> F1[IT Act 2000]

Important Diagrams (SVG)

Diagram 1: Encryption and Decryption

Encryption and Decryption PLAINTEXT readable data ENCRYPTION with a key CIPHERTEXT unreadable data DECRYPTION with matching key PLAINTEXT original data Encryption protects data in transit and at rest. Golden Rule: Encryption converts plaintext to ciphertext; only the key holder can decrypt it.

Diagram 2: Firewall Between LAN and Internet

Firewall - Security Barrier INTERNET FIREWALL filters traffic LOCAL LAN PC1 PC2 ATTACKERS malicious traffic blocked Golden Rule: A firewall permits trusted traffic and blocks untrusted traffic by defined rules.

Common Mistakes

  1. Calling every malware a virus: Worms spread without a host, trojans hide in programs, ransomware encrypts files; each behaves differently.
  2. Saying a firewall is antivirus: A firewall filters network traffic; antivirus scans files for malware. They are complementary, not identical.
  3. Confusing encryption with decryption: Encryption converts plaintext to ciphertext; decryption reverses it.
  4. Believing the Internet is always encrypted: Plain HTTP and unencrypted Wi-Fi expose data; HTTPS and VPNs add encryption.
  5. Treating hacking as always illegal: White hat (ethical) hacking is legitimate; black hat breaking in is a crime.
  6. Underestimating social engineering: Phishing works through human trust, not technical flaws; awareness is the main defence.
  7. Using the same weak password everywhere: One compromised password then exposes every account; unique strong passwords and MFA help.
  8. Ignoring backups: Without backups, ransomware and hardware failure can cause permanent data loss.

Exam Tips

  1. Define each malware type in one line with its distinguishing feature; this is a common one-mark question.
  2. Learn the difference between virus and worm: virus needs host/user action; worm spreads automatically over the network.
  3. Memorise the firewall's role and give an example of what it blocks and allows.
  4. Know encryption vs decryption with a small example; even a Caesar cipher demonstration shows understanding.
  5. State the IT Act, 2000 as India's cyber law and name a few cyber crimes it addresses.
  6. Link protection to scenario: for safe online shopping, HTTPS; for private browsing, VPN; for malware, antivirus.
  7. List the three authentication factors: something you know, have, and are (biometrics).

Conclusion

Security is the discipline that protects the connected world from harm. Understanding threats is the first line of defence: viruses, worms, trojans, spyware and ransomware each spread differently, and attackers use phishing, social engineering and denial-of-service to compromise systems. Defence combines technology and behaviour: firewalls filter traffic, antivirus removes malware, encryption guards data, strong passwords and multi-factor authentication verify identity, and backups guarantee recovery. The IT Act and cyber ethics frame these practices within the law. With networks and their threats understood, the remaining chapters return to programming, beginning with a comprehensive revision of Python fundamentals.