Computing
๐ก Section A: Cybersecurity
๐ 1. Brute Force Attacks
Example: A hacker trying to guess a 4-digit phone lock by trying 1234, 1111, 4321, etc., until it works.
Itโs slow, but works if your password is easy!
๐ How to stay safe:
Use longer, complex passwords like
C@ts4Life!2025Use two-factor authentication (like getting a code on your phone)
๐ 2. Encryption โ Caesar Cipher
It's a type of substitution cipher โ replaces each letter with another one a fixed number of spaces away.
Caesar Cipher Example (shift 4):
Message:
CHATCiphered:
GLEXC โ G
H โ L
A โ E
T โ X
Another Example (shift 1):
Message:
ZEBRACiphered:
AFCSB
/
๐ญ 3. Social Engineering
Type | Example |
|---|---|
Phishing | You get an email from "your bank" asking you to click a link and enter your password |
Pretexting | Someone calls pretending to be IT support asking for your login details |
Baiting | A USB drive is left in a public place labeled "Confidential โ Pay Info" |
Tailgating | Someone follows you into a secure area by pretending they forgot their pass |
๐ค Section B: Machine Learning & AI Ethics
๐ค 1. Machine Learning
Example 1: Spam Filter
Looks at emails and learns which ones are spam based on keywords like "Win now!", "Free prize!", etc.
Learns from examples: some spam, some not.
Example 2: Movie Recommendations
Based on what youโve watched, it suggests what you might like next (like on Netflix or YouTube).
What ML Code Might Look Like:
from sklearn.tree import DecisionTreeClassifier
data = [[5, 100], [3, 75], [10, 150]] # hours studied, marks
labels = ["Pass", "Fail", "Pass"]
model = DecisionTreeClassifier()
model.fit(data, labels)
print(model.predict([[4, 90]])) # โ Predicts Pass or Fail
An AI that sorts CVs but ignores women applicants โ is that ethical?
A robot in a hospital makes decisions about patient treatment โ who is responsible if it makes a mistake?
๐ฉโ๐ป Section C: Reading Python Code
๐ 1. Loops
For loop Example:
for number in range(1, 6):
print("You are on level", number)
Output:
You are on level 1
You are on level 2
You are on level 3
You are on level 4
You are on level 5
While loop Example:
x = 1
while x <= 3:
print("Try number", x)
x += 1
๐ 2. IF Statements
Example 1:
age = 15
if age >= 13:
print("You can sign up!")
else:
print("Sorry, you're too young.")
Example 2 (with multiple conditions):
score = 80
if score >= 90:
print("Grade: A")
elif score >= 70:
print("Grade: B")
else:
print("Grade: C or below")
๐ฎ 3. Events and Collisions (often in games!)
Example Event:
if key_pressed == "space":
jump()
This means the game checks if the spacebar is pressed. If yes, the character jumps.
Example Collision:
if player_rect.colliderect(enemy_rect):
health -= 1
If the player touches (collides with) the enemy, their health goes down.
Example of a game loop:
while game_running:
check_events()
move_player()
check_collisions()
update_screen()