01 / 21

Safe
Computing

Understand the risks of digital life and learn to protect your personal data, privacy, and security in an interconnected world.

AP Computer Science Principles

What Is Safe Computing?

Safe computing is the practice of protecting yourself, your data, and your systems from unauthorized access, exploitation, and harm. As more of our lives move online, understanding security fundamentals is critical for every person and every programmer.

Key Definitions

PII
Personally Identifiable Information: name, SSN, address, biometrics, or any data that can identify you.
Authentication
Verifying that a user is who they claim to be, using passwords, biometrics, or security tokens.
Encryption
Transforming readable data (plaintext) into an unreadable form (ciphertext) so only authorized parties can access it.

The Threat Landscape

Your Data Phishing Malware Data Breach Rogue Wi-Fi Keylogger

Encryption: The Core Defense

Symmetric Plaintext Encrypt Same Key Single shared key Asymmetric Plaintext Encrypt Public Key Private key decrypts HTTPS uses both: Asymmetric to exchange keys, then Symmetric for speed. This is called a hybrid encryption scheme.

Multi-Factor Authentication

Authentication verifies identity. Multi-factor authentication (MFA) requires at least two different types of evidence from distinct categories:

Something You Know
Passwords, PINs, security questions
Something You Have
Phone, hardware token, smart card
Something You Are
Fingerprint, face scan, iris pattern

Phishing vs Malware

Phishing Malware
Method Social engineering: tricks users into revealing data Malicious software installed on a system
Vector Fake emails, websites, messages Downloads, attachments, infected sites
Target Human judgment System vulnerabilities
Defense Education, verifying URLs, skepticism Antivirus, updates, firewalls
Examples Spear phishing, vishing Ransomware, keylogger, trojan

Password Strength

The number of possible passwords grows exponentially. If a character set has \(n\) options and the password is \(k\) characters long, the number of combinations is:

Weak
6 chars, lowercase only: \( 26^6 \approx 3 \times 10^8 \). Cracked in seconds.
Better
8 chars, mixed case + digits: \( 62^8 \approx 2 \times 10^{14} \). Hours to crack.
Strong
12+ chars, full set: \( 95^{12} \approx 5.4 \times 10^{23} \). Effectively uncrackable.

HTTP vs HTTPS

HTTP (Insecure) You plaintext Spy Server HTTPS (Secure) You encrypted Spy (blocked) Server HTTPS = HTTP + TLS/SSL encryption layer

Your Digital Footprint

Every online action creates a digital footprint: a trail of data that can be collected, analyzed, and monetized. This includes both your active contributions and passive traces.

Active Footprint
Data you intentionally share: social posts, emails, uploaded photos, form submissions.
Passive Footprint
Data collected without explicit action: cookies, IP logs, browsing history, location tracking.

How to Stay Safe

1
Use strong, unique passwords. At least 12 characters mixing letters, numbers, and symbols. Use a password manager.
2
Enable multi-factor authentication. Add a second factor (phone, biometric) on every important account.
3
Keep software updated. Patches fix known vulnerabilities that attackers actively exploit.
4
Verify before you click. Check sender addresses, hover over links, and never enter credentials on suspicious pages.
5
Use HTTPS and VPNs on public Wi-Fi. Encrypt your traffic so eavesdroppers cannot read it.

Example: Spotting a Phishing Email

From: security@bankk-alerts.com ★ Misspelled domain Subject: URGENT: Your account has been compromised! Dear Customer, We detected suspicious activity. Click the link below to verify your identity immediately or your account will be suspended within 24 hours. http://bankk-secure-login.fakesit.com/verify ★ Fake URL ★ Urgency pressure ★ Generic greeting ★ Suspicious link

A familiar-looking campus message crosses a trust boundary

A student examines a campus message while its link leads across a trust boundary.A familiar logo or urgent message does not establish the sender’s identity. Use a separately trusted route to reach the service and report suspicious requests.

Check the destination independently

A suspicious campus-message link crosses to portal-check.example while a separate trusted route reaches the service.In this campus-message example, portal-check.example is the destination to inspect. Reach the campus service through a separate trusted route; encryption to a site does not identify the message sender.

Example: Certificate Verification

When you visit an HTTPS site, your browser verifies the server's digital certificate. Here is the trust chain:

Root CA signs Intermediate CA signs Site Certificate Your Browser verifies

Example: Data Breach Impact

A company stores user data. When breached, the impact depends on what was encrypted. Consider two scenarios:

Scenario A: No Encryption
Passwords stored in plaintext. Attackers get full access to every account. Users on other sites with the same password are also vulnerable.
Scenario B: Hashed + Salted
Passwords are hashed with unique salts. Attackers get only gibberish. They cannot reverse the hashes in any practical timeframe.

Common Mistakes

✕ Reusing Passwords
One breach compromises every account that shares that password. Always use unique passwords.
✕ Ignoring Updates
Unpatched software contains known vulnerabilities. Attackers actively scan for outdated systems.
✕ Trusting Public Wi-Fi
Open networks can be monitored. Never enter sensitive data without a VPN or HTTPS.
✕ Oversharing PII
Posting birthdate, school, pet names gives attackers answers to security questions.

Summary: Threats and Defenses

Threat What It Does Defense
Phishing Tricks users into revealing credentials Verify URLs, MFA
Malware Damages or spies on your system Antivirus, updates
Data Breach Exposes stored PII to attackers Encryption, hashing
Rogue Wi-Fi Intercepts unencrypted traffic HTTPS, VPN
Keylogger Records every keystroke MFA, on-screen keyboards
Credential Stuffing Uses leaked passwords on other sites Unique passwords, MFA

Question 1 of 5

Which of the following is the best example of multi-factor authentication?

Question 2 of 5

A user visits a website and notices the URL begins with http:// instead of https://. What risk does this create?

Question 3 of 5

A company stores passwords by applying a hash function with a unique salt for each user. What is the primary benefit of adding a salt?

Question 4 of 5

Which of the following is an example of personally identifiable information (PII) that could be used to steal someone's identity?

Question 5 of 5

Which of the following best describes the primary security concern in this scenario?