Threats and Prevention in Computer Science for Class 12 NCERT
By ConceptScroll Team · Published on 17 July 2026 · 5 min read

In Class 12 NCERT Computer Science, understanding threats and prevention is crucial to protect computer systems from viruses, malware, and hacking. This guide explains common threats and how to prevent them effectively.
Understanding Computer Viruses and Their Impact
A computer virus is a malicious software program designed to damage or disrupt a computer system. Coined by Fred Cohen in 1985, viruses behave like biological viruses by attaching themselves to executable files and spreading when those files run.
Viruses can:
- Consume CPU time
- Corrupt or delete files
- Steal sensitive information like passwords
- Send spam emails
- Take control of the infected system
Common viruses include CryptoLocker, ILOVEYOU, and Stuxnet. These viruses have caused significant damage globally, from encrypting user data to disrupting industrial operations.
Viruses require human action to spread, such as opening infected email attachments or running malicious programs. This makes user awareness and caution the first line of prevention.
Example: Opening an email attachment named "invoice.exe" from an unknown sender may activate a virus that replicates itself across your system.
Understanding viruses helps students identify risky behaviour and the importance of antivirus protection.
Differences Between Viruses, Worms, and Trojans
While viruses are well-known threats, worms and trojans are also common malware types with distinct characteristics:
| Feature | Virus | Worm | Trojan |
|---|---|---|---|
| Replication | Requires user action | Self-replicates automatically | Does not replicate |
| Spread Method | Attaches to executable files | Spreads via networks and emails | Disguised as legitimate software |
| Payload | Damages files, steals data | Consumes bandwidth, damages data | Creates backdoors for hackers |
| Detection | Antivirus software | Network monitoring tools | Behavioural analysis required |
Worms spread rapidly without user intervention, often exploiting network vulnerabilities. Trojans disguise themselves as useful programs but create security loopholes.
Knowing these differences helps Class 12 students understand how each threat operates and the specific prevention strategies needed.
Want to test yourself on Threats and Prevention? Try our free quiz →
Common Threats Beyond Viruses: Malware and Ransomware
Malware is a broad term for malicious software including viruses, worms, trojans, spyware, adware, and ransomware.
- Spyware secretly monitors user activity and sends data to attackers.
- Adware displays unwanted advertisements, often slowing down systems.
- Ransomware encrypts files and demands payment for decryption keys.
Ransomware attacks like CryptoLocker have caused major losses by locking users out of their own data.
Prevention tips:
- Regularly back up important data
- Avoid clicking unknown links or downloading unverified apps
- Keep operating systems and software updated
- Use strong, unique passwords
Understanding malware types helps students grasp the wide range of threats and the importance of comprehensive security measures.
Effective Prevention Techniques to Safeguard Your Computer
Preventing threats requires a combination of technical tools and safe user habits:
- Install Antivirus Software: Regularly scan and update antivirus programs to detect and remove threats.
- Keep Software Updated: Apply security patches promptly to fix vulnerabilities.
- Use Firewalls: Firewalls block unauthorized access to your system.
- Practice Safe Browsing: Avoid suspicious websites and downloads.
- Be Cautious with Emails: Do not open attachments or links from unknown senders.
- Use Strong Passwords: Combine letters, numbers, and symbols; change passwords regularly.
Worked Example:
If you receive an email claiming to be from your bank asking for your password, do not respond or click any links. Instead, visit the bank’s official website directly to verify.
These steps form the core of threat prevention taught in Class 12 NCERT to help students protect their computers.
Role of Network Security and Firewalls in Prevention
Network security is critical to prevent external threats from accessing your computer through the internet or local networks.
Firewalls act as a barrier between your computer and the internet, filtering incoming and outgoing traffic based on security rules.
Benefits of firewalls:
- Block unauthorized access
- Monitor network traffic
- Prevent malware spread
Other network security measures include:
- Using Virtual Private Networks (VPNs) for secure connections
- Disabling unused ports and services
- Regularly updating router firmware
For Class 12 students, understanding network security complements knowledge about viruses and malware, highlighting how threats can enter and be blocked.
Best Practices for Data Backup and Recovery
Data backup is essential to recover from malware attacks, hardware failure, or accidental deletion.
Types of backups:
- Full backup: Copies all data
- Incremental backup: Copies only changed data since last backup
- Differential backup: Copies data changed since last full backup
Backup methods:
- External hard drives
- Cloud storage services
Example formula:
If you perform a full backup on Sunday and incremental backups daily, the total data backed up on Wednesday equals:
$$ ext{Full backup size} + ext{Incremental backups from Monday to Wednesday}$$
Regular backups ensure data safety even if ransomware encrypts your files, allowing you to restore data without paying attackers.
Class 12 NCERT emphasizes backup as a key prevention strategy.
Frequently asked questions
What is the main difference between a virus and a worm?
A virus requires user action to spread, while a worm self-replicates and spreads automatically through networks.
How can antivirus software help in threat prevention?
Antivirus software detects, quarantines, and removes malicious programs like viruses and malware to protect your system.
Why should I avoid opening unknown email attachments?
Unknown attachments may contain viruses or malware that can infect your computer when opened.
What role does a firewall play in computer security?
A firewall blocks unauthorized access to your computer by filtering network traffic based on security rules.
How often should I back up my data to prevent loss?
Regular backups, ideally daily or weekly depending on data importance, help prevent data loss from attacks or failures.
Can updating software prevent computer threats?
Yes, software updates fix security vulnerabilities that hackers and malware exploit to attack systems.
Ready to ace this chapter?
Get the full Threats and Prevention chapter — interactive notes, diagrams, worked solutions, polls and a free practice quiz — in the ConceptScroll app.
Study smarter with ConceptScroll
Daily NCERT-aligned reels, AI doubt solving and chapter quizzes — all free.
Start learning freeContinue reading
- Project Based Learning in Class 12 Computer Science: A Complete Guide
Discover how Project Based Learning (PBL) in Class 12 Computer Science helps students apply concepts through real-world projects, improving problem-solving and teamwork skills.
- Project Based Learning in Class 12 Computer Science: A Complete Guide
Discover how Project Based Learning (PBL) enhances practical skills in Class 12 Computer Science. Understand the process, benefits, and examples from NCERT.
- Project Based Learning in Class 12 Computer Science: A Practical Approach
Discover how Project Based Learning (PBL) in Class 12 Computer Science helps students apply theory through real-world projects, enhancing skills and teamwork.