Blog · 2 September 2026

Cybersecurity for the second Bachaloria year, explained simply

Unit two of the Programming & AI curriculum: encryption, authentication, network security and incident response. Explained with everyday examples, plus practice questions with answers.

What is this unit about?

Unit two of the second-year Bachaloria Programming & AI book is about cybersecurity: how to protect data, accounts and networks. It has three big ideas: encryption and authentication, network security design, and incident response and risk management.

This explanation is ours, to help you understand the idea. For the exam, the reference is the ministry's textbook.

1. Encryption: a message only you can read

Encryption turns a message into a form nobody can understand except whoever holds the key.

The simplest example is the Caesar cipher: shift every letter three places. CAT becomes FDW. Anyone who knows the key is "3" can turn it back.

In practice there are two kinds:

  • Symmetric encryption: the same key locks and unlocks. It is fast, but the problem is getting the key to the other side without anyone seeing it.
  • Asymmetric encryption: two keys: a public one anyone can lock with, and a private one only you hold, which unlocks. That is what is happening when you see the padlock by a site's name (HTTPS).

2. Authentication: proving you are you

Authentication is the system making sure you own the account. It uses one of three things:

  • something you know: a password;
  • something you have: the phone that receives a code;
  • something you are: your fingerprint or face.

Using two of them together is two-factor authentication. Even if your password is stolen, the thief also needs your phone.

3. Network security

A network is like a building: not everyone gets into every flat.

  • Firewall: the doorman who decides who gets in.
  • Network segmentation: a guest's device cannot see the work devices.
  • Least privilege: each user gets only what they need, not everything.
  • Updates: most breaches come through a hole that already has a fix nobody installed.

4. Incident response and risk management

When something happens, there is an order: detect the problem, contain it so it doesn't spread, remove the cause, recover the systems, then learn from it so it doesn't happen again.

Risk is measured with two questions: how likely is it, and how much harm would it do? Start with what is both likely and harmful.

Practice questions (ours, not from an official exam)

  1. Encrypt HELLO with a Caesar cipher, key 3. Answer: KHOOR.
  2. A password plus a code on your phone is an example of what? Answer: two-factor authentication (something you know plus something you have).
  3. Why does asymmetric encryption solve symmetric encryption's problem? Answer: you never send the key that unlocks; you only send the public key.

Want to go deeper?

Eng. Ahmed Tarek teaches this unit on the subject page with examples from real work. He is a product manager at a company whose business is protecting and encrypting video, and his first five videos are free.

Sources

All articles

Start with the free videos.

Sign up, pick your year, and watch every teacher's first five videos before you pay anything. Codes, not cards.