Sunday, March 1, 2026

Computer Security and Ethics


14.1. Introduction to Computer Security

14.1.1 explain the importance of computer security;

14.1.2 explain cybercrime, hacking and cracking;

14.1.3 differentiate among the types of hackers, i.e. script kiddie, white hat hackers, black hat hackers, grey hat hacker, green hat hackers, red hat hackers, blue hat hackers;

14.1.4 differentiate among the types of malware, i.e. virus, worm, adware, spyware, Trojan horses;

14.2 Computer Viruses

14.2.1 discuss the ways in which a malware can spread via:

a. infected flash drives/ CD's

b. pirated software

c. local area network

d. internete. 

e. e-mail attachments;

14.2.2 identify common symptoms of an attack by a malware on a computer system;

14.2.3 Identify the precautions to safeguard computer systems against the ways through which malware can spread mentioned in SLO 14.2.1;

14.3 Authentication Mechanisms

14.3.1 differentiate between authentication and authorisation;

14.3.2 differentiate between Two Factor Authentication (2FA) and Multifactor Authentication (MFA);

14.3.3 describe the following authentication methodologies:

a. username and password

b. Personal Identification Number (PIN)

c. access cards

d. biometrics.

___________________________________________________________________________________

14.1 Introduction to Computer Security

14.1.1 Importance of Computer Security

✅ What is Computer Security?

Computer security means protecting computers, data, and networks from damage, theft, and unauthorized access.

It keeps our information safe from hackers, viruses, and cybercriminals.


✅ Why is Computer Security Important?

Computer security is important because:

  1. Protects Personal Information
    Our computers store:

    • Photos

    • Documents

    • Passwords

    • Bank details

    If security is weak, someone can steal this information.

    📌 Example: If a hacker steals your online banking password, they can take your money.


  1. Prevents Financial Loss
    Companies store important financial records. If hacked, they may lose millions of rupees.

    📌 Example: A company’s system gets hacked and customer credit card data is stolen.


  1. Protects Privacy
    Everyone has the right to privacy. Security helps protect personal chats, emails, and files.

    📌 Example: Without security, someone could read your private emails.


  1. Prevents System Damage
    Malware and viruses can destroy files and slow down computers.

    📌 Example: A virus deletes all files from your computer.


  1. Maintains Trust
    Businesses need strong security so customers trust them.


14.1.2 Cybercrime, Hacking and Cracking

✅ Cybercrime

Cybercrime is a crime committed using a computer or the internet.

📌 Examples of cybercrime:

  • Stealing money online

  • Identity theft

  • Sending fake emails

  • Spreading malware


✅ Hacking

Hacking means accessing a computer system without permission.

Sometimes hacking can be legal (to test security), and sometimes illegal.

📌 Example:

  • Breaking into someone’s social media account.


✅ Cracking

Cracking means breaking security systems with bad intentions.

Crackers:

  • Steal data

  • Damage systems

  • Remove software protection

📌 Example:
Breaking paid software so it can be used for free.


🔎 Difference Between Hacking and Cracking

HackingCracking
Can be legalAlways illegal
May improve securityAlways harmful
Done by ethical hackersDone by criminals

14.1.3 Types of Hackers


🟢 Script Kiddie

  • Beginner hacker

  • Uses ready-made tools

  • Has little knowledge

📌 Example: A student downloads hacking software and tries to break into a game.


⚪ White Hat Hacker

  • Ethical hacker

  • Works legally

  • Helps improve security

📌 Example: A bank hires a white hat hacker to test its website security.


⚫ Black Hat Hacker

  • Criminal hacker

  • Steals data

  • Causes damage

📌 Example: Stealing credit card information.


🟡 Grey Hat Hacker

  • Mix of white and black hat

  • May hack without permission but not for personal gain

📌 Example: Finding a security weakness and informing the company later.


🟢 Green Hat Hacker

  • Beginner who wants to learn hacking

  • Not very experienced


🔴 Red Hat Hacker

  • Fights against black hat hackers

  • Stops cyber criminals


🔵 Blue Hat Hacker

  • Security expert invited to test a system before launch


14.1.4 Types of Malware

🦠 Virus

  • Attaches to files

  • Spreads when file is opened

  • Damages data

📌 Example: A virus deletes Word documents.


🐛 Worm

  • Spreads automatically

  • Does not need a file

📌 Example: Spreads through internet and slows network.


📢 Adware

  • Shows unwanted advertisements.

📌 Example: Pop-up ads opening again and again.


🕵 Spyware

  • Secretly collects information.

📌 Example: Records passwords.


🐴 Trojan Horse

  • Looks like useful software

  • Contains hidden malware

📌 Example: Fake game that installs virus.


14.2 Computer Viruses

14.2.1 How Malware Spreads

a. Infected Flash Drives / CDs

If USB has virus → it spreads when connected.


b. Pirated Software

Illegal software often contains hidden malware.


c. Local Area Network (LAN)

One infected computer can infect others in the same network.


d. Internet

Downloading unsafe files spreads malware.


e. Email Attachments

Opening unknown attachments can install virus.


14.2.2 Symptoms of Malware Attack

  • Computer becomes slow

  • Strange pop-up ads

  • Files deleted automatically

  • Unknown programs installed

  • System crashes frequently


14.2.3 Precautions Against Malware

  • Install antivirus software

  • Do not use pirated software

  • Scan USB before use

  • Do not open unknown email attachments

  • Update operating system regularly

  • Use firewall protection


14.3 Authentication Mechanisms

14.3.1 Authentication vs Authorization

AuthenticationAuthorization
Verifying identityGiving permission
Who are you?What can you do?

📌 Example:
Logging in with password = Authentication
Accessing admin panel = Authorization


14.3.2 2FA vs MFA

Two-Factor Authentication (2FA)

Uses two methods to verify identity.

Example:

  • Password

  • OTP sent to phone


Multi-Factor Authentication (MFA)

Uses two or more methods.

Example:

  • Password

  • OTP

  • Fingerprint


14.3.3 Authentication Methods


a. Username and Password

Most common method.

📌 Example:
Login to Gmail with email and password.


b. PIN (Personal Identification Number)

Short numeric code.

📌 Example:
ATM card PIN.


c. Access Cards

Card used to enter restricted area.


d. Biometrics

Uses body features:

  • Fingerprint

  • Face

  • Eye scan

📌 Example:
Unlocking phone with fingerprint.

___________________________________________________________________________________

14.1.3 Types of Hackers (Detailed Explanation in Simple Language)

Hackers are people who use their computer skills to find weaknesses (security gaps) in computer systems.
Some hackers use their skills for good purposes, while others use them for bad purposes.

Let’s explain each type in detail with examples.


🟢 Script Kiddie

✅ Who are Script Kiddies?

A script kiddie is a beginner hacker who does not have much technical knowledge.
They use ready-made hacking tools or software created by others.

They do not understand how hacking really works — they just download tools and try them.

✅ Characteristics:

  • Little experience

  • Uses tools made by others

  • Hacks for fun, attention, or to impress friends

  • Sometimes causes damage without knowing

📌 Example:

A student downloads a password cracking tool from the internet and tries to hack a game account.

❗ Danger Level:

Medium — because even without knowledge, they can still cause harm using powerful tools.


⚪ White Hat Hacker (Ethical Hacker)

✅ Who are White Hat Hackers?

White hat hackers are ethical hackers.
They hack legally and with permission to improve security.

Their job is to:

  • Find security weaknesses

  • Report problems

  • Help companies fix them

✅ Characteristics:

  • Highly skilled

  • Work for companies or government

  • Follow laws and ethics

  • Help protect systems

📌 Example:

A bank hires a white hat hacker to test its website to make sure criminals cannot steal customer data.

🎯 Purpose:

To protect systems and stop cybercrime.


⚫ Black Hat Hacker

✅ Who are Black Hat Hackers?

Black hat hackers are criminal hackers.
They hack systems for money, revenge, or personal benefit.

They break into systems without permission.

✅ Characteristics:

  • Illegal activities

  • Steal data

  • Spread malware

  • Damage systems

📌 Example:

A hacker breaks into a company’s database and steals customers’ credit card details.

❗ Danger Level:

Very High — because they can cause serious financial and data loss.


🟡 Grey Hat Hacker

✅ Who are Grey Hat Hackers?

Grey hat hackers are in between white and black hat hackers.

They may hack without permission, but they usually do not want to harm anyone.

Sometimes they:

  • Find security weaknesses

  • Inform the company

  • Ask for reward

✅ Characteristics:

  • Break rules but not always criminals

  • May not have bad intentions

  • Do not always take permission first

📌 Example:

A person finds a weakness in a website and tells the company after hacking into it.

⚠ Important:

Even if their intention is good, hacking without permission is still illegal.


🟢 Green Hat Hacker

✅ Who are Green Hat Hackers?

Green hat hackers are beginners who want to learn hacking properly.

They:

  • Study cybersecurity

  • Practice legally

  • Want to become ethical hackers

✅ Characteristics:

  • New learners

  • Interested in security

  • Still gaining experience

📌 Example:

A student taking a cybersecurity course and learning how firewalls work.


🔴 Red Hat Hacker

✅ Who are Red Hat Hackers?

Red hat hackers fight against black hat hackers.

They are like “digital soldiers” who:

  • Attack criminal hackers

  • Destroy their systems

  • Protect organizations

✅ Characteristics:

  • Very aggressive toward criminals

  • Focus on stopping cybercrime

  • Work to protect networks

📌 Example:

A red hat hacker tracks down a cybercriminal and disables their hacking server.


🔵 Blue Hat Hacker

✅ Who are Blue Hat Hackers?

Blue hat hackers are security experts invited by companies to test a system before launching it.

They are usually hired for:

  • Finding weaknesses

  • Testing new software

📌 Example:

A software company invites a blue hat hacker to test a new app before releasing it to the public.


✅ Quick Comparison Table

TypePurposeLegal or Illegal?
Script KiddieFor fun / attentionUsually illegal
White HatImprove securityLegal
Black HatSteal / damageIllegal
Grey HatMix of bothSometimes illegal
Green HatLearningLegal
Red HatFight criminalsLegal (if authorized)
Blue HatTesting systemsLegal

🎯 Simple Summary

  • White hat = Good hacker

  • Black hat = Bad hacker

  • Grey hat = In between

  • Script kiddie = Beginner using tools

  • Green hat = Learning hacker

  • Red hat = Fights criminals

  • Blue hat = Security tester

Monday, February 16, 2026

ALGORITHM AND FLOWCHART 16-20


Unit 7: Algorithm and Flowchart

7.1 Understanding the Problem

7.1.1 Describe the following steps of the problem-solving process:

  • a. Define the problem

  • b. Analyse the problem

  • c. Planning the solution of the problem

  • d. Find candid solutions of the problem

  • e. Select the best solution


7.2 Algorithm

7.2.1 Define an algorithm. 7.2.2 Describe the following four essential parts of an algorithm:

  • a. Inputs

  • b. Processing

  • c. Decision

  • d. Outputs 

7.1 Understanding the Problem

When we solve a problem using a computer (for example in C language), we follow some steps. These steps help us write correct programs.


7.1.1 Steps of the Problem-Solving Process


a. Define the Problem

This is the first and most important step.

To define the problem means:

  • Clearly understand what we have to do

  • Know what the user wants

  • Know what result is required

Simple Meaning:

Before writing any program, we must clearly say:

"What is the problem?"

Example:

Problem:
"Write a program to calculate the average of three numbers."

Here the problem is clearly defined:

  • Input: 3 numbers

  • Output: Average

If we don’t define the problem properly, the program may give wrong results.


b. Analyse the Problem

After defining the problem, we must analyze it.

To analyze means:

  • Break the problem into smaller parts

  • Identify:

    • What are the inputs

    • What processing is required

    • What will be the output

Example:

Problem: Calculate average of 3 numbers.

Analysis:

  • Inputs → Number1, Number2, Number3

  • Process → Add them and divide by 3

  • Output → Average

In C language, this means:

  • We need 3 variables for input

  • 1 variable for average

  • Use formula:

    average = (num1 + num2 + num3) / 3;

c. Planning the Solution of the Problem

Now we plan how to solve the problem.

This includes:

  • Writing algorithm

  • Drawing flowchart

  • Deciding variables

  • Deciding formulas

Simple Meaning:

We decide:

"How will we solve the problem step by step?"

Example Plan:

  1. Start

  2. Input 3 numbers

  3. Add numbers

  4. Divide by 3

  5. Display average

  6. Stop

Planning helps us avoid errors while writing C program.


d. Find Candidate Solutions of the Problem

Sometimes a problem can be solved in more than one way.

Candidate solutions mean:

  • Different possible methods to solve the same problem.

Example:

Problem: Check whether a number is positive or negative.

Method 1:

  • Use if (num > 0)

Method 2:

  • Use ternary operator:

    (num > 0) ? "Positive" : "Negative";

Both are correct solutions. These are candidate solutions.


e. Select the Best Solution

After finding different solutions, we select the best one.

Best solution means:

  • Easy to understand

  • Uses less memory

  • Runs faster

  • Simple logic

Example:

Between:

  • Complex nested conditions

  • Simple if-else

We select:
✔ Simple if-else because it is easier for students to understand.


7.2 Algorithm


7.2.1 Define an Algorithm

Definition:

An algorithm is a step-by-step procedure to solve a problem.

It is written in simple English language.

It tells:

  • What to do

  • In what order to do

Before writing C program, we first write algorithm.


Example Algorithm:

Problem: Add two numbers

  1. Start

  2. Input number1

  3. Input number2

  4. sum = number1 + number2

  5. Display sum

  6. Stop

This is an algorithm.


7.2.2 Four Essential Parts of an Algorithm

Every algorithm has four important parts.


a. Inputs

Inputs are:

  • The data given to the program

  • Values entered by the user

In C language:
We use:

scanf()

Example:

If we calculate area of rectangle:

  • Input → length and width


b. Processing

Processing means:

  • Performing calculations

  • Applying formulas

  • Doing logical operations

In C language:
We use:

  • Arithmetic operators (+, -, *, /)

  • Assignment operator (=)

Example:

area = length * width;

This step is called processing.


c. Decision

Decision means:

  • Making a choice

  • Checking conditions

In C language:
We use:

  • if

  • if-else

  • switch

Example:

If we check even or odd:

if (num % 2 == 0) printf("Even"); else printf("Odd");

This is decision making.


d. Outputs

Output means:

  • The final result of the program

  • What we show to the user

In C language:
We use:

printf()

Example:

printf("The sum is %d", sum);

✅ Summary

Problem Solving Steps:

  1. Define the problem

  2. Analyse the problem

  3. Plan the solution

  4. Find possible solutions

  5. Select best solution

Algorithm:

  • A step-by-step method to solve a problem.

Four Parts of Algorithm:

  • Input

  • Processing

  • Decision

  • Output

7.2.3 Write algorithms for solving problems, i.e.:
  • a. Performing arithmetic, relational, and logical operations

  • b. Calculating the volume of geometrical shapes

  • c. Finding the area of various geometrical shapes

  • d. Converting from one unit to another unit of physical quantities

  • e. Finding the maximum and minimum from input values

  • f. Performing the counting and totaling on given values

  • g. Applying the repetition process

  • h. Applying the selection process


7.3 Flowchart

7.3.1 Define a program flowchart. 

7.3.2 Describe the importance of a program flowchart for solving a problem. 

7.3.3 Identify the flowchart symbols for the following:

  • a. Input

  • b. Process

  • c. Decision making

  • d. Outputs

  • e. Terminator/terminal point

  • f. Connectors

7.3.1 Define a Program Flowchart

Definition:

A program flowchart is a diagram that shows the steps of a program using symbols.

It shows:

  • What step comes first

  • What step comes next

  • How the program flows

  • Where decisions are made

A flowchart uses standard symbols connected with arrows.


Simple Meaning:

An algorithm is written in words.
A flowchart shows the same steps in picture form (diagram form).


Example:

Problem: Add two numbers

Algorithm:

  1. Start

  2. Input two numbers

  3. Add numbers

  4. Display result

  5. Stop

Flowchart shows the same steps using symbols and arrows.


7.3.2 Importance of a Program Flowchart

Flowchart is very important before writing a C program.


✅ 1. Makes the Problem Easy to Understand

When we see the problem in diagram form, it becomes easier to understand.

Instead of reading long text, we can understand quickly by looking at the symbols.


✅ 2. Helps in Planning the Program

Flowchart helps programmers:

  • Arrange steps in correct order

  • Avoid missing steps

  • Remove logical mistakes

Before writing code in C, drawing a flowchart reduces errors.


✅ 3. Makes Debugging Easy

If there is a mistake:

  • We can easily find it in the flowchart

  • Then correct the logic

This saves time.


✅ 4. Improves Communication

Flowcharts help:

  • Teachers explain programs

  • Students understand logic

  • Programmers discuss ideas

Even a person who does not know C language can understand the flowchart.


✅ 5. Converts Easily into C Program

Each symbol in flowchart matches C statements:

  • Input symbol → scanf()

  • Process symbol → calculations

  • Decision symbol → if-else

  • Output symbol → printf()

7.3.3 Flowchart Symbols

Now we will identify and explain important symbols.


a. Input Symbol



Shape:

Parallelogram


Use:

Used to take input from user.

C Language Example:

scanf("%d", &num);

Example in Flowchart:

Input number


b. Process Symbol

Shape:

Rectangle


Use:

Used for:

  • Calculations

  • Assignments

  • Processing data

C Language Example:

sum = num1 + num2;

c. Decision Making Symbol

Shape:

Diamond


Use:

Used when condition is checked.

It has:

  • Two outputs → Yes / No

  • True / False

C Language Example:

if (num % 2 == 0)

d. Output Symbol

Shape:

Parallelogram (same as input)

Use:

Used to display result.


C Language Example:

printf("Result = %d", sum);

e. Terminator / Terminal Point

✅ Summary Table

SymbolShapeUsed ForC Language Example
InputParallelogramTake inputscanf()
ProcessRectangleCalculationsum = a + b
DecisionDiamondCondition checkingif-else
OutputParallelogramDisplay resultprintf()
TerminatorOvalStart / StopStart, End
ConnectorCircleJoin flow linesContinue 

7.3.4 Draw flowcharts for the problems mentioned in SLO 7.2.3. 

7.3.5 Complete the trace table for a given flowchart.

FLOWCHART & Questions From the Book