High School Computer Science

Cybersecurity, Ethics and Society网络安全、伦理与社会

Every time you log in, share a file, or post online, you are operating in a digital world shaped by security threats, ethical choices, and societal tradeoffs. This guide covers the full landscape: how attackers exploit systems through malware, phishing, and social engineering; how encryption and authentication defend against them; the safe computing habits that protect your data; the privacy and ethics questions raised by data collection; how intellectual property law and open-source licensing govern software; computing's sweeping effects on jobs, equity, and culture; and the emerging challenges of algorithmic bias, digital accessibility, and environmental sustainability. All seven sections are bilingual and cite the four curricula that cover these topics.每次你登录、共享文件或在线发布内容时,你都在一个由安全威胁(security threats,安全威胁)、伦理选择(ethical choices,伦理选择)和社会权衡构成的数字世界中运作。本指南涵盖全貌:攻击者如何通过恶意软件(malware,恶意软件)、钓鱼(phishing,钓鱼)和社会工程学利用系统;加密(encryption,加密)和身份验证(authentication,身份验证)如何防御攻击;保护数据的安全计算习惯;数据收集引发的隐私(privacy,隐私)和伦理(ethics,伦理)问题;知识产权(intellectual property,知识产权)法律和开源(open source,开源)许可如何管理软件;计算对就业、公平和文化的深远影响;以及算法偏见、数字可访问性(accessibility,可访问性)和环境可持续性(sustainability,可持续性)的新兴挑战。

7 sections7 节内容 US CSTA · AP CSP · ON · BC · ABUS CSTA · AP CSP · ON · BC · AB Ethics · Society · Security伦理 · 社会 · 安全

Cybersecurity Threats网络安全威胁

Learning objectives学习目标
  • Identify malware, phishing and social engineering in a short scenario and justify the label with evidence from the scenario.
  • Distinguish a virus, worm, Trojan, ransomware and spyware by how each spreads or what it does.
  • Spot the red flags in a suspicious email, including a link whose real host differs from its visible text.
  • Recommend one defence for each threat and explain which weakness it closes.
  • 识别短场景中的恶意软件、钓鱼和社会工程学(social engineering),并用场景中的证据说明理由。
  • 按传播方式或作用区分病毒、蠕虫、木马、勒索软件和间谍软件。
  • 发现可疑电子邮件中的危险信号,包括真实主机与显示文字不一致的链接。
  • 为每种威胁推荐一项防御措施,并解释它堵住了哪个弱点。
Three threat categories: know all three cold.三类威胁:完全掌握这三类。
  • Malware恶意软件: malicious software designed to damage, disrupt, or gain unauthorized access. Subtypes: virus (attaches to files and self-replicates), worm (spreads across networks without a host file), Trojan (disguises itself as legitimate software), ransomware (encrypts victim data and demands payment), spyware (records activity without consent). BC CS10 names malware, Trojans, viruses, phishing scams, identity fraud, and ransomware verbatim.:旨在破坏、干扰或获取未授权访问权限的恶意软件(malware)。子类型:病毒(附着于文件并自我复制)、蠕虫(无需宿主文件在网络中传播)、木马(伪装成合法软件)、勒索软件(加密受害者数据并索取赎金)、间谍软件(未经同意记录活动)。BC CS10 原文命名了恶意软件、木马、病毒、钓鱼诈骗、身份欺诈和勒索软件。
  • Phishing钓鱼: fraudulent attempts to obtain sensitive information (passwords, credit card numbers) by impersonating a trusted entity via email, SMS, or a fake website. Spear phishing targets a specific individual using personalised details; pharming redirects DNS to a fake site. Ontario ICS4U D2.1 lists phishing as an example ethical issue.:通过冒充可信实体(电子邮件、短信或虚假网站)获取敏感信息(密码、信用卡号)的欺诈行为(phishing,钓鱼)。鱼叉式钓鱼利用个人化细节针对特定个人;域欺骗将 DNS 重定向到虚假网站。安大略 ICS4U D2.1 将钓鱼列为伦理问题示例。
  • Social engineering社会工程学: manipulating people into revealing confidential information or taking actions that compromise security, by exploiting trust, authority, urgency, or fear rather than technical exploits. Examples: pretexting (fabricating a scenario), baiting (leaving an infected USB drive), tailgating (following someone through a secure door). CSTA 3A-NI-05 says: "Give examples to illustrate how sensitive data can be affected by malware and other attacks.":通过利用信任、权威、紧迫感或恐惧(而非技术漏洞)来操纵人们泄露机密信息或采取危害安全的行动(social engineering,社会工程学)。示例:借口攻击(捏造场景)、诱骗(留下受感染的 USB 驱动器)、尾随(跟随他人通过安全门)。CSTA 3A-NI-05 要求:"举例说明敏感数据如何受到恶意软件和其他攻击的影响。"
Key distinction: malware exploits software vulnerabilities; social engineering exploits human vulnerabilities. Both are addressed in the threat model because the weakest link is often the user, not the code.关键区别:恶意软件利用软件漏洞;社会工程学利用人类漏洞。两者都纳入威胁模型,因为最薄弱的环节往往是用户,而非代码。
Worked Example 1: Identifying the attack type例题 1:识别攻击类型

Read each scenario and identify the threat category (malware, phishing, social engineering).阅读每个场景并识别威胁类别(恶意软件、钓鱼、社会工程学)。

Scenario A.场景 A。 You receive an email that looks like it is from your bank, asking you to "verify your account" by clicking a link and entering your password. The link goes to a site that looks identical to your bank but has a slightly different URL.你收到一封看起来来自你的银行的电子邮件,要求你通过点击链接并输入密码来"验证账户"。该链接指向一个看起来与你的银行相同但 URL 略有不同的网站。

Threat type: Phishing.威胁类型:钓鱼。 The attacker impersonates a trusted entity (the bank) to steal credentials. The fake URL is the tell-tale sign. Defence: inspect URLs carefully; go directly to the bank's site rather than clicking email links.攻击者冒充可信实体(银行)来窃取凭据。虚假 URL 是识别信号。防御:仔细检查 URL;直接访问银行网站而非点击电子邮件链接。

Scenario B.场景 B。 Someone downloads a free game from an unofficial site. When they run it, their files become encrypted and a message demands payment to restore them.有人从非官方网站下载了一款免费游戏。运行后,他们的文件被加密,并出现一条消息要求付款以恢复文件。

Threat type: Malware (ransomware).威胁类型:恶意软件(勒索软件)。 The game was a Trojan that delivered ransomware. Defence: download software only from trusted sources; maintain backups.该游戏是一个传递勒索软件的木马。防御:仅从可信来源下载软件;保持备份。

Scenario C.场景 C。 A caller claims to be from IT support and tells an employee their account has been compromised. They ask the employee to read out their password so IT can "fix" the problem immediately.一名来电者自称来自 IT 支持,告诉员工其账户已被入侵。他们要求员工读出密码,以便 IT 可以立即"修复"问题。

Threat type: Social engineering (pretexting).威胁类型:社会工程学(借口攻击)。 No malware is needed; the attacker exploits authority and urgency. Legitimate IT support will never ask for a password. Defence: verify identities through official channels; never share passwords verbally.不需要恶意软件,攻击者利用权威和紧迫感。合法的 IT 支持永远不会要求提供密码。防御:通过官方渠道验证身份;切勿口头分享密码。

Worked Example 2: Reading a suspicious email例题 2:阅读一封可疑邮件

An email reaches a student's inbox, shown in Figure 1. List its red flags, name the attack category, and say what the student should do.一名学生的收件箱里收到一封电子邮件,见图 1。列出其中的危险信号,说出攻击类别,并说明学生应该怎么做。

Step 1. The sender. The address ends in northbank-alerts.example, but the bank's own domain is northbank.example. A display name can say anything; the domain after the @ is what identifies the sender. Red flag 1: a look-alike domain.步骤 1. 发件人。地址以 northbank-alerts.example 结尾,而银行自己的域名是 northbank.example。显示名称可以随便写;@ 后面的域名才能标识发件人。危险信号 1:外观相似的域名。

Step 2. Pressure. The subject threatens a lock within 24 hours. Urgency and fear are social engineering levers: they push the reader to act before checking. Red flag 2.步骤 2. 施压。主题威胁账户将在 24 小时内被锁定。紧迫感和恐惧是社会工程学的杠杆:它们促使读者在核实之前就行动。危险信号 2。

Step 3. The greeting. "Dear customer" is generic, so the sender may not know who you are. This flag is weak on its own, because real organisations also send mass emails, but it adds to the pattern. Red flag 3.步骤 3. 称呼。"尊敬的客户"是通用称呼,说明发件人可能并不知道你是谁。这个信号单独出现时较弱,因为正规机构也会群发邮件,但它会让整体模式更可疑。危险信号 3。

Step 4. The link. The visible text reads www.northbank.example/login, but hovering over the link shows the real destination, northbank.example.verify-now.example/login. Read a host name from right to left: the last two labels, verify-now.example, name who runs the site (for a multi-part suffix such as co.uk, take three labels), and everything to their left is a subdomain that the site's owner can choose freely. So this link leads to the owner of verify-now.example, not to the bank. Red flags 4 and 5: the text and the target differ, and the real host is not the bank's.步骤 4. 链接。显示文字是 www.northbank.example/login,但鼠标悬停在链接上会显示真实目的地 northbank.example.verify-now.example/login。主机名要从右往左读:最后两段 verify-now.example 说明谁在运营这个网站(遇到 co.uk 这类多段后缀时,取最后三段),其左边的部分只是该网站所有者可以随意取的子域名。因此这个链接指向 verify-now.example 的所有者,而不是银行。危险信号 4 和 5:显示文字与目标不一致,且真实主机不是银行的。

Step 5. Category and response. This is phishing: an impersonation attempt by email that tries to collect a password. No software has run yet, so it is not malware (an attachment could change that). The student should not click, reply or type a password. Instead, open the bank's site by typing its address or use its official app, and report the email. If a password was already entered, change it at the real site at once, change it anywhere it was reused, and turn on MFA. Why this works: the safe response leaves the attacker's channel entirely and checks with the real organisation.步骤 5. 类别与应对。这是钓鱼(phishing):通过电子邮件冒充他人、试图骗取密码。目前还没有任何软件运行,所以它不是恶意软件(附件可能改变这一点)。学生不应点击、回复或输入密码,而应自己输入网址或使用官方应用打开银行网站,并举报这封邮件。如果已经输入了密码,要立刻在真正的网站上修改,凡是重复使用过该密码的地方也都要修改,并开启 MFA。为什么有效:安全的做法完全离开攻击者的渠道,直接向真正的机构核实。

From: help@northbank-alerts.example发件人: help@northbank-alerts.example URGENT: account locked in 24 h紧急:账户将在 24 小时内锁定 Dear customer,尊敬的客户, Verify your password now:请立即验证您的密码: www.northbank.example/loginwww.northbank.example/login Hover shows: northbank.example.悬停显示:northbank.example. verify-now.example/loginverify-now.example/login 11 Sender domain does发件域名与银行 not match the bank不一致 22 Urgency and a threat紧迫感与威胁 33 Generic greeting通用称呼 44 Link text looks right显示文字看似正确 but check the target但要核对目标 55 Real host: read it真实主机: from the right从右往左读
Figure 1. A phishing email with five numbered red flags: (1) a look-alike sender domain, (2) an urgent threat, (3) a generic greeting, (4) link text that looks right, (5) a real destination whose domain, read from the right, is not the bank's. Match each number to a step of Worked Example 2.图 1. 带有五个编号危险信号的钓鱼邮件:(1) 外观相似的发件域名,(2) 紧急威胁,(3) 通用称呼,(4) 看似正确的链接文字,(5) 真实目的地,其域名从右往左读并不是银行的。请把每个编号与例题 2 的步骤对应起来。
Which type of malware encrypts a victim's files and demands payment to restore access?哪种恶意软件类型会加密受害者的文件并要求付款以恢复访问权限?
§1 · Q1
Virus病毒
Worm蠕虫
Ransomware勒索软件
Spyware间谍软件
Ransomware encrypts victim data and demands payment (a ransom) for the decryption key. It is often delivered via Trojans or phishing emails. BC CS10 names ransomware verbatim in its security risks content.勒索软件加密受害者数据并要求支付赎金以获取解密密钥。它通常通过木马或钓鱼电子邮件传递。BC CS10 在其安全风险内容中原文命名了勒索软件。
Virus = self-replicates by attaching to files. Worm = spreads across networks without a host file. Spyware = records activity silently. Ransomware = encrypts and demands payment.病毒 = 通过附着于文件自我复制。蠕虫 = 无需宿主文件在网络中传播。间谍软件 = 悄悄记录活动。勒索软件 = 加密并要求付款。
An attacker leaves an infected USB drive in a company parking lot, hoping an employee will plug it in. What attack category does this fall under?攻击者在公司停车场留下一个受感染的 USB 驱动器,希望员工将其插入电脑。这属于哪种攻击类别?
§1 · Q2
Phishing钓鱼
Social engineering (baiting)社会工程学(诱骗)
Malware (worm)恶意软件(蠕虫)
Ransomware勒索软件
Baiting is a social engineering technique that exploits curiosity: the attacker provides a physical lure (the USB drive). The USB may contain malware, but the attack vector is social engineering, not a technical exploit against software.诱骗是一种利用好奇心的社会工程学技术:攻击者提供物理诱饵(USB 驱动器)。USB 可能包含恶意软件,但攻击向量是社会工程学,而非针对软件的技术漏洞利用。
Phishing is email/web impersonation. Worms spread automatically. This is social engineering (baiting) because it exploits human curiosity, not a software vulnerability.钓鱼是电子邮件/网页冒充。蠕虫自动传播。这是社会工程学(诱骗),因为它利用人类好奇心,而非软件漏洞。
Exam tip考试提示

Command words: identify means name the category (malware, phishing or social engineering); justify means quote the evidence from the scenario, such as a sender domain that differs from the bank's; recommend means name one defence and the weakness it closes. Common errors: calling every attack a virus or "hacking", writing "it looks fake" without evidence, and giving a defence that does not match the threat (a strong password does not help against ransomware that is already on the machine).

指令词:identify(识别)是指说出类别(恶意软件、钓鱼或社会工程学);justify(说明理由)是指引用场景中的证据,例如与银行不一致的发件域名;recommend(推荐)是指说出一项防御措施及其堵住的弱点。常见错误:把所有攻击都叫作病毒或"黑客攻击",只写"看起来是假的"而不给证据,以及给出与威胁不匹配的防御(强密码对已经在机器上的勒索软件没有帮助)。

Check your understanding自我检测
What separates a worm from a virus?蠕虫与病毒的区别是什么?

A virus attaches itself to a host file and spreads when that file is run or shared. A worm is a standalone program that copies itself across a network without needing a host file or a user to open anything, so it can spread much faster.

病毒附着在宿主文件上,在该文件被运行或共享时传播。蠕虫是独立的程序,无需宿主文件,也无需用户打开任何东西,就能通过网络自我复制,因此传播速度可以快得多。

A text message says a parcel is held and asks you to follow a link to pay a small fee. Name the category and one defence.一条短信说包裹被扣留,要求你点击链接支付一笔小额费用。说出攻击类别和一项防御措施。

Phishing by text message (sometimes called smishing): it impersonates a delivery company to collect payment details. Defence: do not follow the link; check the delivery through the company's official app or website, typed in yourself.

短信钓鱼(有时称为 smishing):冒充快递公司来骗取付款信息。防御:不要点击链接;通过自己输入网址或官方应用,向快递公司核实包裹情况。

A link's real host is login.northbank.example.verify-now.example. Who runs the site?某链接的真实主机是 login.northbank.example.verify-now.example。谁在运营这个网站?

Read from the right: the last two labels are verify-now.example, so the owner of that domain runs it. The labels login.northbank.example to the left are just a subdomain name that owner chose, and they are chosen to look like the bank.

从右往左读:最后两段是 verify-now.example,所以该域名的所有者在运营它。左边的 login.northbank.example 只是所有者取的子域名,目的是看起来像银行。

Why do backups defend against ransomware but not against spyware?为什么备份能防御勒索软件,却不能防御间谍软件?

Ransomware attacks availability: it locks your files, and a clean backup lets you restore them without paying. Spyware attacks confidentiality: it copies what you do or type to someone else, and restoring files does not take back what was already stolen. Spyware needs prevention and removal, such as updates and trusted sources.

勒索软件攻击的是可用性:它锁住你的文件,而干净的备份让你无需付款就能恢复。间谍软件攻击的是保密性:它把你的操作或输入复制给别人,恢复文件无法收回已被窃取的内容。对付间谍软件需要预防和清除,例如及时更新和只用可信来源。

Going deeper: threat actors and the attack surface深入:威胁行为者和攻击面

CSTA 3A-NI-06 says: "Recommend security measures to address various scenarios based on factors such as efficiency, feasibility, and ethical impacts." Understanding who attacks and why is the first step in choosing proportionate defences. Threat actors range from opportunistic script-kiddies running pre-built malware kits, to organised criminal groups monetising ransomware, to state-sponsored actors conducting espionage. The attack surface is the sum of all the different points where an attacker could try to enter or extract data: network ports, software interfaces, physical hardware, and most importantly, people. Reducing the attack surface means keeping software patched, disabling unused services, and training users to recognise social engineering, because the human is consistently the easiest point of entry. BC Computer Studies 10 Curricular Competency "Examine how cultural beliefs, values, and ethical positions affect the development and use of technologies" applies here: norms around sharing passwords, downloading software, and clicking email links are cultural, not purely technical.CSTA 3A-NI-06 要求:"根据效率、可行性和伦理影响等因素,推荐针对各种场景的安全措施。"了解谁在攻击以及原因是选择适当防御措施的第一步。威胁行为者范围从运行预建恶意软件套件的机会主义脚本小子,到将勒索软件货币化的有组织犯罪团伙,再到进行间谍活动的国家支持行为者。攻击面是攻击者可能尝试进入或提取数据的所有不同点的总和:网络端口、软件接口、物理硬件,以及最重要的:人。减少攻击面意味着保持软件补丁更新、禁用未使用的服务,以及培训用户识别社会工程学,因为人类始终是最容易进入的点。BC Computer Studies 10 课程能力"检查文化信仰、价值观和伦理立场如何影响技术的开发和使用"在这里适用:关于共享密码、下载软件和点击电子邮件链接的规范是文化性的,而非纯粹技术性的。


Encryption and Authentication加密与身份验证

Learning objectives学习目标
  • Explain the difference between symmetric and asymmetric encryption and state which key does what.
  • Encrypt and decrypt with a Caesar cipher and explain why its tiny key space makes it insecure.
  • Trace a message from sender to recipient using public-key encryption, saying which key is used at each step.
  • Explain why HTTPS uses both kinds of encryption.
  • Describe what a hash is, why a salt is added, and how a hash differs from encryption.
  • Decide whether a login uses multi-factor authentication by naming the factor type of each step.
  • 解释对称加密与非对称加密的区别,并说明各个密钥的作用。
  • 用凯撒密码加密和解密,并解释其极小的密钥空间为何使它不安全。
  • 追踪一条使用公钥加密的消息从发送方到接收方的过程,并说明每一步使用哪个密钥。
  • 解释为什么 HTTPS 同时使用两种加密。
  • 描述什么是哈希(hash),为什么要加盐,以及哈希与加密有何不同。
  • 通过说出每一步的因素类型,判断一次登录是否使用了多因素认证。
Two encryption models: know the difference cold.两种加密模型:熟记区别。
  • Symmetric encryption对称加密: the same key is used to encrypt and decrypt. Fast; suitable for large data (e.g., encrypting a hard drive with AES). Problem: how do you share the key securely in the first place?:使用相同的密钥进行加密和解密。速度快;适合大数据(如使用 AES 加密硬盘)。问题:如何在一开始就安全地共享密钥?
  • Asymmetric encryption非对称加密: uses a mathematically linked key pair: a public key (shareable with anyone) and a private key (kept secret). Anything encrypted with the public key can only be decrypted with the private key. Used in HTTPS (TLS), email signing, and SSH. Slower than symmetric; typically used to exchange a symmetric session key.:使用数学上关联的密钥对:公钥(可与任何人共享)和私钥(保密)。用公钥加密的任何内容只能用私钥解密(asymmetric encryption,非对称加密)。用于 HTTPS(TLS)、电子邮件签名和 SSH。比对称加密慢;通常用于交换对称会话密钥。
  • Authentication身份验证: proving you are who you claim to be. Three factors: something you know (password, PIN), something you have (phone, hardware token), something you are (fingerprint, face). Multi-factor authentication (MFA) combines at least two factors, dramatically reducing the impact of a stolen password. CSTA 3A-NI-07: "Compare various security measures, considering tradeoffs between the usability and security of a computing system.":证明你就是你所声称的人。三个因素:你知道的东西(密码、PIN)、你拥有的东西(手机、硬件令牌)、你本身的特征(指纹、面部)。多因素认证(MFA,多因素认证)结合至少两个因素,大大降低了密码被盗的影响。CSTA 3A-NI-07:"比较各种安全措施,考虑计算系统可用性和安全性之间的权衡。"
The key insight for exams: encryption protects data at rest (stored) and in transit (being sent). HTTPS encrypts web traffic. A strong password alone is not MFA; MFA requires a second independent factor.考试关键洞察:加密保护静态数据(已存储)和传输中数据(正在发送)。HTTPS 加密 Web 流量。单独使用强密码不是 MFA,MFA 需要第二个独立因素。
Worked Example 3: The padlock analogy for asymmetric encryption例题 3:非对称加密的挂锁类比

Asymmetric encryption is often compared to a padlock system. Imagine Alice wants to receive secret messages from anyone.非对称加密通常与挂锁系统相比较。想象 Alice 想从任何人那里接收秘密消息。

Step 1: Alice publishes her public key.步骤 1:Alice 发布她的公钥。 The public key is like an open padlock Alice hands out freely. Anyone can snap it shut (encrypt a message). Alice keeps the private key (the key that opens the padlock).公钥就像 Alice 自由分发的开放式挂锁。任何人都可以将其锁上(加密消息)。Alice 保留私钥(打开挂锁的钥匙)。

Step 2: Bob writes a message and locks it with Alice's public key.步骤 2:Bob 写一条消息并用 Alice 的公钥锁上。 Even Bob cannot open the locked box; once locked with Alice's public key, only Alice's private key can open it.即使是 Bob 也无法打开锁着的盒子,一旦用 Alice 的公钥锁上,只有 Alice 的私钥才能打开。

Step 3: Alice decrypts with her private key.步骤 3:Alice 用她的私钥解密。 Only Alice can read the message. Eavesdroppers who intercept the encrypted message see only ciphertext, meaningless without the private key.只有 Alice 才能阅读消息。截获加密消息的窃听者只看到密文,没有私钥毫无意义。

Why HTTPS uses both types.为什么 HTTPS 同时使用两种类型。 Asymmetric encryption solves the key-sharing problem: browser and server use asymmetric crypto to agree on a symmetric session key securely. All subsequent data is encrypted with the faster symmetric key. This hybrid approach is how TLS (the protocol behind HTTPS) works.非对称加密解决了密钥共享问题:浏览器和服务器使用非对称加密来安全地协商一个对称会话密钥。所有后续数据都用更快的对称密钥加密。这种混合方式就是 TLS(HTTPS 背后的协议)的工作原理。

Bob writesBob 写下 the plaintext明文 Encrypt with用 Alice 的 Alice's PUBLIC key公钥加密 Ciphertext goes密文经网络 over the network传输 Ciphertext密文 arrives at Alice到达 Alice Decrypt with用 Alice 的 Alice's PRIVATE key私钥解密 Alice readsAlice 读到 the plaintext明文 Public key: shared with anyone公钥:可以交给任何人 An eavesdropper sees only this窃听者只能看到密文 Private key: only Alice holds it私钥:只有 Alice 持有
Figure 2. Public-key encryption. Bob locks the message with Alice's public key, which anyone may have; only Alice's private key unlocks it, so an eavesdropper on the network sees only ciphertext. Follow the arrows along the top row, down, then along the bottom row.图 2. 公钥加密。Bob 用 Alice 的公钥锁住消息,公钥可以让任何人持有;只有 Alice 的私钥能够解开,因此网络上的窃听者只能看到密文。沿上排箭头、向下、再沿下排箭头阅读。
Worked Example 4: Caesar cipher and key space例题 4:凯撒密码与密钥空间

A Caesar cipher shifts every letter forward by a key k and wraps from Z back to A. (a) Encrypt MEET AT NOON with k = 3. (b) Decrypt the result. (c) An observer sees PHHW DW QRRQ and does not know the key. How many keys must be tried at most, and what does that say about security?凯撒密码把每个字母向后移动密钥 k 位,并从 Z 回绕到 A。(a) 用 k = 3 加密 MEET AT NOON。(b) 解密结果。(c) 观察者看到 PHHW DW QRRQ,但不知道密钥。最多需要试多少个密钥?这说明了什么安全问题?

(a) Encrypt. Number the letters A = 0, B = 1, ..., Z = 25. To encrypt, add the key and wrap around: $c = (p + k) \bmod 26$. With $k = 3$: M (12) becomes 15 = P, E (4) becomes 7 = H, T (19) becomes 22 = W, N (13) becomes 16 = Q, O (14) becomes 17 = R, A becomes D. Spaces stay. So MEET AT NOON becomes PHHW DW QRRQ. Wrapping matters near the end of the alphabet: X (23) plus 3 is 26, which wraps to 0 = A.(a) 加密。给字母编号 A = 0,B = 1,……,Z = 25。加密时加上密钥并循环回绕:$c = (p + k) \bmod 26$。取 $k = 3$:M(12)变为 15 = P,E(4)变为 7 = H,T(19)变为 22 = W,N(13)变为 16 = Q,O(14)变为 17 = R,A 变为 D。空格保持不变。于是 MEET AT NOON 变成 PHHW DW QRRQ。接近字母表末尾时要回绕:X(23)加 3 得 26,回绕为 0 = A。

(b) Decrypt. Subtract the same key: $p = (c - k) \bmod 26$. The same secret key does both jobs, so this is symmetric encryption. The code below does both directions and also tries every key.(b) 解密。减去同一个密钥:$p = (c - k) \bmod 26$。同一个秘密密钥完成两项工作,所以这是对称加密。下面的代码完成两个方向,并尝试所有密钥。

def shift_letter(ch, k):
    if "A" <= ch <= "Z":
        return chr((ord(ch) - ord("A") + k) % 26 + ord("A"))
    return ch          # spaces and punctuation stay as they are

def caesar(text, k):
    return "".join(shift_letter(ch, k) for ch in text)

cipher = caesar("MEET AT NOON", 3)
print(cipher)                 # encrypt with key 3
print(caesar(cipher, -3))     # decrypt with the same key, reversed

# brute force: try every possible key
for k in range(1, 26):
    guess = caesar("PHHW DW QRRQ", -k)
    if k <= 4:
        print(k, guess)
print(26 - 1, "possible keys")

# Output:
# PHHW DW QRRQ
# MEET AT NOON
# 1 OGGV CV PQQP
# 2 NFFU BU OPPO
# 3 MEET AT NOON
# 4 LDDS ZS MNNM
# 25 possible keys

(c) How many keys, and is this secure? A shift of 0 or 26 leaves the text unchanged, so there are only 25 useful keys. Trying all 25 takes a computer far less than a second, and the readable line appears at key 3. A modern symmetric cipher such as AES with a 128-bit key has $2^{128} \approx 3.4 \times 10^{38}$ possible keys. At an assumed $10^{12}$ guesses per second that would take about $10^{19}$ years to search. The lesson: a cipher's security should rest on a huge key space and a secret key, not on keeping the method secret. The Caesar cipher is a teaching tool, not protection.(c) 有多少个密钥,安全吗?位移 0 或 26 不改变文本,所以只有 25 个有用的密钥。试遍 25 个密钥,计算机用不了一秒钟,在密钥 3 时就会出现可读的句子。现代对称密码(例如使用 128 位密钥的 AES)有 $2^{128} \approx 3.4 \times 10^{38}$ 个可能的密钥。假设每秒猜测 $10^{12}$ 次,要搜索完大约需要 $10^{19}$ 年。启示:密码的安全性应建立在巨大的密钥空间和保密的密钥之上,而不是保密算法本身。凯撒密码只是教学工具,不能提供保护。

Why this works. Counting keys turns "is it secure?" into arithmetic: 25 keys can be tried in an instant, $2^{128}$ keys cannot.为什么有效。数一数密钥个数,就把"它安全吗"变成了算术问题:25 个密钥瞬间即可试完,$2^{128}$ 个则不可能。

Which encryption type uses the same key for both encrypting and decrypting data?哪种加密类型使用相同的密钥进行数据的加密和解密?
§2 · Q1
Symmetric encryption对称加密
Asymmetric encryption非对称加密
Multi-factor authentication多因素认证
Hashing哈希
Symmetric encryption uses one shared key for both operations. It is fast but requires a secure way to share the key. Example: AES (the older DES is no longer considered secure). Contrast with asymmetric, which uses a key pair (public + private).对称加密使用一个共享密钥进行两种操作。速度快,但需要安全的密钥共享方式。示例:AES(较早的 DES 已不再被视为安全)。与使用密钥对(公钥+私钥)的非对称加密对比。
Symmetric = same key for encrypt and decrypt. Asymmetric = public key encrypts, private key decrypts. MFA is authentication, not encryption. Hashing is one-way transformation, not encryption.对称 = 加密和解密使用相同密钥。非对称 = 公钥加密,私钥解密。MFA 是身份验证,不是加密。哈希是单向转换,不是加密。
A user logs in with a password and then receives a six-digit code on their phone that they must also enter. What security measure is this?用户用密码登录,然后在手机上收到一个六位数代码,也必须输入。这是什么安全措施?
§2 · Q2
Symmetric encryption对称加密
Public key infrastructure公钥基础设施
Multi-factor authentication (MFA)多因素认证(MFA)
Phishing defence防钓鱼
MFA combines at least two authentication factors. Here: something you know (password) + something you have (the phone receiving the code). Even if an attacker steals the password, they cannot log in without also having the phone.MFA 结合至少两个认证因素。这里:你知道的东西(密码)+你拥有的东西(接收代码的手机)。即使攻击者窃取了密码,没有手机也无法登录。
This describes MFA (two independent factors: password + phone code). Encryption protects data in transit/at rest; it is not what verifies identity at login.这描述的是 MFA(两个独立因素:密码 + 手机代码)。加密保护传输中/静态数据;它不是在登录时验证身份的方式。
Exam tip考试提示

Command words: state which key is used (public or private) at each step; explain why HTTPS uses both kinds (asymmetric to agree on a key safely, symmetric because it is fast for the bulk of the data); compare two ideas using the same criteria. Common errors: saying the public key decrypts, calling a hash "encryption" (a hash cannot be reversed, encryption can), and treating a password plus a security question as MFA (both are something you know).

指令词:state(陈述)每一步使用哪个密钥(公钥还是私钥);explain(解释)为什么 HTTPS 两种都用(非对称用于安全地协商密钥,对称因为处理大量数据时速度快);compare(比较)两个概念时使用同一套标准。常见错误:说公钥用来解密,把哈希叫作"加密"(哈希不可逆,加密可逆),以及把密码加安全问题当作 MFA(两者都是你知道的东西)。

Check your understanding自我检测
Bob wants to send Alice a secret over the internet. Which key does Bob use, and which key does Alice use?Bob 想通过互联网给 Alice 发送机密消息。Bob 使用哪个密钥,Alice 使用哪个密钥?

Bob encrypts with Alice's public key, which Alice can publish freely. Alice decrypts with her private key, which only she holds. Anyone who intercepts the ciphertext cannot read it without that private key.

Bob 用 Alice 的公钥加密,Alice 可以公开发布这把公钥。Alice 用只有她持有的私钥解密。截获密文的人没有这把私钥就无法阅读。

A site asks for a password and then for the name of your first pet. Is this MFA? When is a password-plus-phone-code login allowed?某网站要求输入密码,然后要求输入你第一只宠物的名字。这是 MFA 吗?密码加手机验证码的登录在什么情况下才被允许?

No. Both are something you know, so one factor type is used twice. For a password plus a phone code (know plus have), access is allowed only if the password is correct AND the code is correct. The other three combinations (wrong password, wrong code, or both wrong) are denied, so a stolen password alone is not enough.

不是。两者都是你知道的东西,同一种因素类型用了两次。对于密码加手机验证码(知道加拥有),只有密码正确并且验证码正确时才允许访问。其余三种组合(密码错、验证码错或两者都错)都被拒绝,所以仅靠被盗的密码是不够的。

How can a site check your password without storing it, and what does a salt add?网站如何在不存储密码的情况下检查你的密码?加盐增加了什么?

It stores a hash such as SHA-256 of the password. At login it hashes what you typed and compares the digests; the hash cannot be turned back into the password. A salt is a random value stored with each user's hash and mixed in before hashing, so two users with the same password get different digests and one precomputed table cannot be reused against every user. A salt does not make a weak password strong.

它存储密码的哈希(例如 SHA-256)。登录时对你输入的内容进行哈希并比较摘要;哈希无法还原成密码。盐是随每个用户的哈希一起存储、在哈希前混入的随机值,因此两个密码相同的用户会得到不同的摘要,预先计算好的一张表也就不能用来对付所有用户。盐不会让弱密码变强。

Why does HTTPS not simply use public-key encryption for everything?为什么 HTTPS 不干脆全程使用公钥加密?

Public-key operations are much slower than symmetric ones. HTTPS uses public-key methods to agree on a shared session key safely, then uses fast symmetric encryption for the rest of the traffic.

公钥运算比对称运算慢得多。HTTPS 用公钥方法安全地协商一个共享的会话密钥,然后用快速的对称加密处理其余流量。

Going deeper: passwords, hashing, and salting深入:密码、哈希与加盐

Websites should not store passwords in plaintext. Instead, they store a hash: the output of a one-way function that converts the password into a fixed-length string (e.g., SHA-256 produces a 256-bit output). When you log in, the site hashes your input and compares it to the stored hash; the original password is never stored. The problem: if two users have the same password, they produce the same hash, making it easy for an attacker with the hash database to use precomputed "rainbow tables." The solution is salting: add a unique random string (the salt) to each password before hashing, making each stored hash unique even for identical passwords. CSTA 3A-NI-07 on security tradeoffs and CSTA 3B-NI-04 ("Compare ways software developers protect devices and information from unauthorized access") cover this design tradeoff. Ontario ICS4U D2.1 lists "sharing passwords" as an ethical issue; understanding why plaintext password storage is negligent is the flip side of that ethics question.网站不应以明文存储密码。相反,它们存储哈希值:一种将密码转换为固定长度字符串的单向函数的输出(如 SHA-256 产生 256 位输出)。登录时,网站对你的输入进行哈希并与存储的哈希进行比较;原始密码从不存储。问题:如果两个用户有相同的密码,它们产生相同的哈希,使得拥有哈希数据库的攻击者可以使用预先计算的"彩虹表"。解决方案是加盐:在哈希之前向每个密码添加唯一的随机字符串(盐),使每个存储的哈希唯一,即使对于相同的密码也是如此。CSTA 3A-NI-07 关于安全权衡和 CSTA 3B-NI-04("比较软件开发人员保护设备和信息免受未授权访问的方式")涵盖了这种设计权衡。安大略 ICS4U D2.1 将"共享密码"列为伦理问题,理解为什么明文密码存储是疏忽大意,是这个伦理问题的另一面。


Safe Computing Practices安全计算实践

Learning objectives学习目标
  • Calculate a password search space as (character-set size) raised to the length, and compare lengths and character sets.
  • Estimate brute-force time at a stated guess rate and say what the estimate does and does not show.
  • Explain why unique passwords and salted hashes limit the damage of a breach.
  • Judge a backup plan against the 3-2-1 rule and the ransomware threat.
  • Evaluate a safe-computing decision by stating the security gain and the usability cost.
  • 把密码搜索空间计算为(字符集大小)的长度次方,并比较不同长度和字符集。
  • 在给定猜测速度下估算暴力破解所需时间,并说明该估算能说明什么、不能说明什么。
  • 解释为什么唯一的密码和加盐的哈希能限制数据泄露造成的损害。
  • 依据 3-2-1 规则和勒索软件威胁来评判备份方案。
  • 通过说明安全收益与可用性成本来评估一项安全计算决策。
The essential personal-security checklist: know all six.基本个人安全清单:掌握全部六项。
  • Strong, unique passwords强且唯一的密码: at least 12 characters, mixing letters, numbers, and symbols. Never reuse a password across sites. Use a password manager to generate and store them.:至少 12 个字符,混合字母、数字和符号。不要在各网站之间重复使用密码。使用密码管理器生成和存储密码。
  • Software updates and patches软件更新和补丁: much malware exploits known vulnerabilities that already have patches available. Keeping OS, browsers, and apps updated closes these holes. BC CS10 names "software updates, patches" verbatim in its preventive maintenance content.:许多恶意软件利用已有补丁可用的已知漏洞。保持操作系统、浏览器和应用程序更新可以关闭这些漏洞。BC CS10 在其预防性维护内容中原文命名了"软件更新、补丁"。
  • Backups备份: the 3-2-1 rule: 3 copies of your data, on 2 different media, with 1 copy offsite (or in cloud storage). Backups are the primary defence against ransomware.:3-2-1 规则:数据的 3 个副本,存储在 2 种不同介质上,其中 1 个副本在异地(或云存储中)。备份是对抗勒索软件的主要防御手段。
  • HTTPS and secure connectionsHTTPS 和安全连接: check for the padlock icon and https:// in the URL bar, but remember that phishing sites can use HTTPS too. The padlock means the connection is encrypted, not that the site is trustworthy. HTTPS encrypts data in transit using TLS, preventing eavesdropping on public Wi-Fi.:检查 URL 栏中的挂锁图标和 https://,但要记住钓鱼网站也可以使用 HTTPS。挂锁只表示连接已加密,并不表示网站可信。HTTPS 使用 TLS 加密传输中的数据,防止在公共 Wi-Fi 上被窃听。
  • Think before you click点击前先思考: hover over links to preview the actual URL. Verify sender email addresses. Be sceptical of unexpected attachments. Many phishing attacks succeed because users click without checking.:悬停在链接上预览实际 URL。验证发件人电子邮件地址。对意外附件保持怀疑。许多钓鱼攻击得逞,是因为用户未经检查就点击了。
  • Privacy settings and minimal disclosure隐私设置和最少披露: review app permissions; disable location, microphone, and camera access for apps that do not need them. Share only the minimum information required for a service.:审查应用程序权限;禁用不需要位置、麦克风和摄像头访问的应用程序的这些权限。仅共享服务所需的最少信息。
CSTA 3A-NI-08: "Explain tradeoffs when selecting and implementing cybersecurity recommendations." Every security measure has a usability cost; knowing the tradeoff is part of the skill.CSTA 3A-NI-08:"解释在选择和实施网络安全建议时的权衡。"每项安全措施都有可用性成本:了解权衡是技能的一部分。
Worked Example 5: Safe or unsafe? Evaluate each decision例题 5:安全还是不安全?评估每个决策

AP CSP Skill 5.E says: "Evaluate the use of computing based on legal and ethical factors." Apply the same evaluative lens to security decisions.AP CSP 技能 5.E 要求:"根据法律和伦理因素评估计算的使用。"将同样的评估视角应用于安全决策。

Decision 1:决策 1: Using the same password ("password123") for your email, social media, and bank. Unsafe. A single breach exposes all three accounts. This is called credential stuffing: attackers take a leaked username/password pair and try it on many sites. Fix: unique password per site, stored in a password manager.对电子邮件、社交媒体和银行使用相同的密码("password123")。不安全。单次泄露会暴露所有三个账户。这称为凭据填充:攻击者获取泄露的用户名/密码对并在许多网站上尝试。修复:每个网站使用唯一密码,存储在密码管理器中。

Decision 2:决策 2: Connecting to a coffee shop's free Wi-Fi and accessing your online banking without a VPN. Risky. Public Wi-Fi is often unencrypted; a nearby attacker could perform a man-in-the-middle attack. HTTPS mitigates this significantly, but a VPN adds an extra layer of protection. Fix: use banking apps over cellular, or use a VPN on public Wi-Fi.连接到咖啡店的免费 Wi-Fi 并在没有 VPN 的情况下访问网上银行。有风险。公共 Wi-Fi 通常未加密;附近的攻击者可能执行中间人攻击。HTTPS 大大缓解了这一问题,但 VPN 增加了额外的保护层。修复:通过蜂窝网络使用银行应用程序,或在公共 Wi-Fi 上使用 VPN。

Decision 3:决策 3: Enabling automatic OS updates on your laptop. Safe and recommended. Automatic updates apply security patches promptly, closing vulnerabilities before attackers can exploit them. The usability tradeoff is occasional restarts; the security benefit far outweighs this inconvenience.在笔记本电脑上启用操作系统自动更新。安全且推荐。自动更新及时应用安全补丁,在攻击者利用漏洞之前关闭漏洞。可用性权衡是偶尔需要重启;安全收益远大于这种不便。

Worked Example 6: How long does a password search take?例题 6:破解一个密码要搜索多久?

A site stores salted SHA-256 hashes of its users' passwords. An attacker holding the stolen hashes can make $10^{10}$ guesses per second (an assumed rate). Compare the worst-case search time for (a) 8 lowercase letters, (b) 8 characters from 94 printable ASCII characters, and (c) 12 characters from the same 94. (d) Show what a salt does to two identical passwords.某网站存储用户密码的加盐 SHA-256 哈希。持有被盗哈希的攻击者每秒可以猜测 $10^{10}$ 次(假设速度)。比较以下情况的最坏搜索时间:(a) 8 个小写字母,(b) 从 94 个可打印 ASCII 字符中取 8 个字符,(c) 从同样的 94 个字符中取 12 个字符。(d) 说明盐对两个相同密码起什么作用。

Setting. Passwords are stored as hashes. An attacker who has stolen the hash database guesses offline. Assume $10^{10}$ guesses per second (ten billion per second). This is a round number chosen for illustration; real rates depend on the hardware and on how slow the hash function is made. Searching the whole space is the worst case; on average a guess succeeds after about half of it.设定。密码以哈希形式存储。拿到被盗哈希数据库的攻击者在离线状态下猜测。假设每秒 $10^{10}$ 次猜测(每秒一百亿次)。这是为了演示而选的整数;实际速度取决于硬件以及哈希函数被设计得有多慢。搜索整个空间是最坏情况;平均而言,大约猜完一半时就会成功。

(a) 8 lowercase letters. The search space is the character-set size raised to the length: $26^8 = 208{,}827{,}064{,}576 \approx 2.1 \times 10^{11}$. Time for the whole space: $2.09 \times 10^{11} / 10^{10} \approx 20.9$ seconds.(a) 8 个小写字母。搜索空间等于字符集大小的长度次方:$26^8 = 208{,}827{,}064{,}576 \approx 2.1 \times 10^{11}$。搜索整个空间的时间:$2.09 \times 10^{11} / 10^{10} \approx 20.9$ 秒。

(b) 8 characters from 94 printable ASCII characters. $94^8 \approx 6.1 \times 10^{15}$. Time: $6.1 \times 10^{15} / 10^{10} \approx 609{,}569$ seconds, which is about 7.1 days.(b) 从 94 个可打印 ASCII 字符中取 8 个字符。$94^8 \approx 6.1 \times 10^{15}$。时间:$6.1 \times 10^{15} / 10^{10} \approx 609{,}569$ 秒,约 7.1 天。

(c) 12 characters from the same 94. $94^{12} \approx 4.76 \times 10^{23}$. Time: about $4.76 \times 10^{13}$ seconds, roughly 1.5 million years. Going from 8 to 12 characters multiplies the space by $94^4 = 78{,}074{,}896$.(c) 从同样的 94 个字符中取 12 个字符。$94^{12} \approx 4.76 \times 10^{23}$。时间:约 $4.76 \times 10^{13}$ 秒,大约 150 万年。从 8 个字符增加到 12 个字符,空间扩大 $94^4 = 78{,}074{,}896$ 倍。

import hashlib

def sha(text):
    return hashlib.sha256(text.encode()).hexdigest()

print(len(sha("sunshine")))              # hex digits in a SHA-256 digest
print(sha("sunshine")[:16])              # unsalted: same for every user
print(sha("a1B2" + "sunshine")[:16])     # user 1, salt a1B2
print(sha("k9Zx" + "sunshine")[:16])     # user 2, salt k9Zx

rate = 10**10                            # assumed guesses per second
print(26**8, 26**8 / rate)               # 8 lowercase letters: seconds
print(94**8 / rate / (60 * 60 * 24))     # 8 mixed characters: days
print(94**12 / rate / (60 * 60 * 24 * 365))   # 12 mixed characters: years

# Output:
# 64
# a941a4c4fd0c01cd
# de53fa03d2f894f6
# a4685eed33879e1a
# 208827064576 20.8827064576
# 7.0551960479291855
# 1509133.418360773

(d) What a salt changes. The first line shows that a SHA-256 digest is 64 hexadecimal digits (256 bits). The unsalted digest of sunshine is the same for every user and every site, so one precomputed table of common passwords serves against all of them. With the salts a1B2 and k9Zx the two users' stored digests differ even though their passwords are identical, so the attacker must work on each user separately. The salt is stored beside the hash; it is not a secret key.(d) 盐改变了什么。第一行输出显示 SHA-256 摘要是 64 个十六进制数字(256 位)。sunshine 的未加盐摘要对每个用户、每个网站都相同,因此一张预先计算好的常见密码表就能对付所有人。使用盐 a1B2 和 k9Zx 后,两个用户虽然密码相同,存储的摘要却不同,攻击者必须逐个用户处理。盐与哈希存放在一起,它不是秘密密钥。

Caveats. The figures assume each character was chosen at random. People choose patterns such as sunshine1, and attackers try common passwords first, so a predictable password falls far faster than its search space suggests. Length beats complexity: four extra characters help more than swapping a few letters for symbols. A longer password cannot be called unhackable; it only makes guessing impractical.注意事项。这些数字假设每个字符都是随机选取的。人们会选 sunshine1 这样的模式,而攻击者会先尝试常见密码,所以可预测的密码被破解的速度远快于其搜索空间所显示的。长度胜过复杂度:多加四个字符比把几个字母换成符号更有帮助。较长的密码也不能说是"无法破解",只是让猜测变得不切实际。

Which of the following is the BEST defence against ransomware?以下哪项是对抗勒索软件的最佳防御措施?
§3 · Q1
Using a strong password使用强密码
Enabling HTTPS启用 HTTPS
Turning off your computer when not in use不使用时关闭电脑
Maintaining regular offline backups保持定期离线备份
Ransomware encrypts your files; the attacker demands payment for the decryption key. If you have recent offline backups, you can restore your files without paying. Offline (not cloud-only) backups are critical because some ransomware also encrypts cloud-synced files.勒索软件加密你的文件;攻击者要求支付赎金以获取解密密钥。如果你有最新的离线备份,可以在不付款的情况下恢复文件。离线(而非仅云端)备份至关重要,因为某些勒索软件也会加密云同步文件。
Strong passwords protect accounts, not files already on your machine. HTTPS protects data in transit. Only backups allow recovery after ransomware encrypts your data.强密码保护账户,而非机器上已有的文件。HTTPS 保护传输中的数据。只有备份才能在勒索软件加密数据后进行恢复。
Why is reusing the same password across multiple websites a significant security risk?为什么在多个网站上重复使用相同的密码是一个重大安全风险?
§3 · Q2
It makes the password easier for attackers to guess它使攻击者更容易猜出密码
A breach at one site exposes all accounts using that password (credential stuffing)一个网站的泄露会暴露使用该密码的所有账户(凭据填充)
Websites can see each other's password databases网站可以看到彼此的密码数据库
Reused passwords expire faster重复使用的密码过期更快
Credential stuffing: when one site's database is breached and hashes cracked, attackers try those username/password pairs on other major sites (email, banking). If you reuse passwords, one breach compromises everything. Unique passwords per site limit the blast radius of any single breach.凭据填充:当一个网站的数据库被攻破且哈希被破解时,攻击者在其他主要网站(电子邮件、银行)上尝试这些用户名/密码对。如果你重复使用密码,一次泄露就会危及所有账户。每个网站使用唯一密码可以限制任何单次泄露的影响范围。
The risk is not about guessing difficulty; it is about credential stuffing after a breach. One breached site leads to attacks on all sites where you used the same password.风险不在于猜测难度,而在于泄露后的凭据填充。一个被攻破的网站会导致对你使用相同密码的所有网站的攻击。
Exam tip考试提示

Command words: calculate means write the formula, the numbers and the unit (seconds, days or years); evaluate means give the security gain and the usability cost, then reach a judgement. Common errors: multiplying (26 × 8 = 208) instead of raising to a power ($26^8$), mixing seconds and years in one line, and claiming a password is "unhackable". State the guess rate you assumed, because the answer depends on it.

指令词:calculate(计算)要写出公式、数字和单位(秒、天或年);evaluate(评估)要给出安全收益和可用性成本,然后下结论。常见错误:用乘法(26 × 8 = 208)而不是乘方($26^8$),在同一行里混用秒和年,以及声称密码"无法破解"。要写明你假设的猜测速度,因为答案取决于它。

Check your understanding自我检测
A phone PIN has 4 digits. How many PINs are there, and how many with 6 digits? Why does the offline rate above matter little for a phone that locks after a few wrong tries?手机 PIN 码有 4 位数字。共有多少种 PIN?6 位数字又有多少种?为什么对于几次输错就锁定的手机,上面的离线猜测速度影响不大?

$10^4 = 10{,}000$ PINs and $10^6 = 1{,}000{,}000$ PINs, a factor of 100. The fast-guessing model needs the attacker to test guesses against stolen hashes at full speed. A phone that locks or delays after a few wrong tries limits the guess rate itself, so the attempt limit protects a short PIN far more than its size does.

$10^4 = 10{,}000$ 种 PIN,$10^6 = 1{,}000{,}000$ 种 PIN,相差 100 倍。高速猜测模型要求攻击者以全速对被盗哈希逐一测试。几次输错就锁定或延迟的手机限制了猜测速度本身,所以尝试次数限制对短 PIN 的保护远比其位数更重要。

A student keeps files on a laptop, copies them to a USB stick that stays plugged in, and syncs them to cloud storage. Does this meet 3-2-1, and is it safe against ransomware?一名学生把文件存在笔记本电脑上,复制到一直插着的 U 盘,并同步到云存储。这符合 3-2-1 规则吗?能防勒索软件吗?

On paper it has 3 copies, on 2 or more kinds of storage, with 1 offsite (the cloud). But ransomware running on the laptop can encrypt the plugged-in USB stick, and the sync service may copy the encrypted files to the cloud. Fix: keep at least one copy disconnected or in storage with version history, and test a restore.

表面上有 3 份副本,存放在 2 种以上的存储上,其中 1 份在异地(云端)。但在笔记本电脑上运行的勒索软件可以加密一直插着的 U 盘,同步服务也可能把加密后的文件复制到云端。改进:至少保留一份断开连接的副本,或使用带版本历史的存储,并测试恢复。

A user has one 12-character random password and uses it on five sites. Why is that still risky?某用户有一个 12 位随机密码,并在五个网站上使用。为什么这仍然有风险?

Length protects against guessing, but not against reuse. If any one of the five sites is breached and its password is recovered or leaked, attackers try the same pair on the other four (credential stuffing). Use a unique password per site, kept in a password manager.

长度可以防止被猜出,却防不了重复使用。五个网站中任何一个被攻破、密码被还原或泄露,攻击者就会拿同一组凭据去试另外四个(凭据填充)。每个网站使用唯一的密码,并保存在密码管理器中。

An app logs you out after one minute of inactivity. Evaluate this choice.某应用在闲置一分钟后自动退出登录。评估这一选择。

Security gain: a lost or unattended device exposes the account for less time. Usability cost: frequent sign-ins annoy users, who may then choose weaker passwords or skip protection. A balanced design matches the timeout to the sensitivity of the data, such as a short timeout for banking and a longer one for a music app.

安全收益:设备丢失或无人看管时,账户暴露的时间更短。可用性成本:频繁登录让用户厌烦,他们可能因此选用更弱的密码或绕过保护。平衡的设计会让超时时间与数据的敏感程度相匹配,例如银行应用设置较短的超时,音乐应用则设置较长的超时。


Privacy and Data Ethics隐私与数据伦理

Learning objectives学习目标
  • Classify data as PII or not, including details that identify a person only in combination.
  • Apply data minimisation to decide which fields a service really needs.
  • Explain informed consent and secondary use, and judge a scenario against them.
  • Show, by counting group sizes, why removing names does not make a data set anonymous.
  • State why computing professionals have codes of ethics and cite one principle.
  • 判断数据是否属于 PII,包括只有组合起来才能识别个人的细节。
  • 应用数据最小化原则,判断一项服务真正需要哪些字段。
  • 解释知情同意与二次使用,并据此评判一个场景。
  • 通过统计组大小,说明为什么去掉姓名并不能使数据集匿名。
  • 说明计算专业人员为什么要有职业伦理准则,并引用其中一项原则。
Four core concepts: know the distinctions.四个核心概念:掌握区别。
  • Personally identifiable information (PII)个人可识别信息(PII): any data that can identify an individual: name, email, address, phone number, social security number, biometrics. CSTA 3A-IC-29: "Explain the privacy concerns related to the collection and generation of data through automated processes that may not be evident to users.":可以识别个人的任何数据:姓名、电子邮件、地址、电话号码、社会安全号码、生物特征。CSTA 3A-IC-29:"解释与通过自动化流程收集和生成数据相关的隐私问题,这些问题对用户可能并不明显。"
  • Data collection and informed consent数据收集与知情同意: users should know what data is collected, why, and how it is used. "Informed consent" means the user genuinely understands the tradeoff, not merely clicked "I agree" on a 50-page terms of service. AP CSP Topic 5.6 covers this under safe computing.:用户应了解收集了哪些数据、原因和使用方式。"知情同意"意味着用户真正了解权衡,而不仅仅是在 50 页服务条款上点击了"我同意"。AP CSP 主题 5.6 在安全计算下涵盖了这一点。
  • Data minimisation数据最小化: collect only the data you need for the stated purpose. A weather app needs your location; it does not need your contacts. Ethical data practice means refusing to collect data "just in case.":仅收集实现既定目的所需的数据。天气应用需要你的位置;它不需要你的联系人。伦理数据实践意味着拒绝"以防万一"地收集数据。
  • Secondary use and data brokers二次使用与数据经纪人: data collected for one purpose (e.g., a loyalty card purchase history) may be sold to third parties and used for different purposes (targeted advertising, insurance pricing). Data brokers aggregate and sell personal profiles. CSTA 3A-IC-30: "Evaluate the social and economic implications of privacy in the context of safety, law, or ethics.":为一个目的(如忠诚卡购买历史)收集的数据可能被出售给第三方并用于不同目的(定向广告、保险定价)。数据经纪人聚合并出售个人档案(data brokers,数据经纪人)。CSTA 3A-IC-30:"在安全、法律或伦理的背景下评估隐私的社会和经济影响。"
Ontario ICS4U D2.1 lists as ethical issues (verbatim): "sharing passwords, music and video file downloading, software piracy, keystroke logging, phishing, cyberbullying." Privacy and data ethics underpin the last three of those.安大略 ICS4U D2.1 将以下内容列为伦理问题(原文):"共享密码、下载音乐和视频文件、软件盗版、键盘记录、钓鱼、网络欺凌。"隐私和数据伦理是其中最后三项的基础。
Worked Example 7: What does a free app actually collect?例题 7:免费应用实际收集什么?

A free mobile flashlight app asks for permission to access: your location, contacts, microphone, camera, and storage. Evaluate what data collection is proportionate.一款免费的手机手电筒应用请求权限访问:你的位置、联系人、麦克风、摄像头和存储。评估哪些数据收集是合理的。

Proportionate (arguably):合理的(可以说是): Storage access (to save settings). No other permissions are needed for a flashlight.存储访问(保存设置)。手电筒不需要其他任何权限。

Disproportionate:不合理的: Location, contacts, microphone, camera. A flashlight only needs to turn on the LED. Requesting these permissions serves a secondary purpose; selling your data to brokers. This is the "free" business model: you pay with your personal data instead of money.位置、联系人、麦克风、摄像头。手电筒只需要打开 LED。请求这些权限服务于二次目的,将你的数据出售给经纪人。这就是"免费"商业模式:你用个人数据代替金钱付款。

Ethical evaluation (AP CSP Skill 5.E):伦理评估(AP CSP 技能 5.E): The app violates data minimisation principles. A user who clicks "I agree" without reading permissions has not given meaningful informed consent. Regulators such as the GDPR (EU) and PIPEDA (Canada) require that data collection be limited to what is necessary for the service.该应用违反了数据最小化原则。未阅读权限就点击"我同意"的用户没有给予有意义的知情同意。GDPR(欧盟)和 PIPEDA(加拿大)等监管机构要求数据收集仅限于服务所必需的内容。

Safe practice:安全实践: Review app permissions before installing. Deny any permission the app does not logically need. Prefer apps that clearly explain why each permission is required.安装前检查应用权限。拒绝应用逻辑上不需要的任何权限。优先选择清楚说明每个权限需要原因的应用。

Worked Example 8: Is the data really anonymous?例题 8:数据真的匿名吗?

A club publishes survey results for nine students with names removed, keeping each student's grade and home area. Use a count of group sizes to decide whether any student can be singled out, then suggest a fix and say what it costs.一个社团发布了九名学生的调查结果,去掉了姓名,保留每名学生的年级和居住区域。通过统计组大小,判断是否有学生能被挑出来,然后提出改进办法并说明其代价。

Setting. A school club publishes survey results with names removed. Each of the nine records keeps the student's grade and home area (A or B), plus an answer. The code counts how many records share each (grade, area) pair; the smallest group size is called $k$.设定。一个学校社团发布了去掉姓名的调查结果。九条记录中的每一条都保留了学生的年级和居住区域(A 或 B),以及一个答案。代码统计每个(年级,区域)组合有多少条记录;最小的组大小称为 $k$。

from collections import Counter

records = [("Gr10", "A"), ("Gr10", "A"), ("Gr10", "A"),
           ("Gr11", "A"), ("Gr11", "B"), ("Gr11", "B"),
           ("Gr12", "A"), ("Gr12", "B"), ("Gr12", "B")]

groups = Counter(records)
print(len(records), "records,", len(groups), "groups")
print(min(groups.values()))
for key, size in sorted(groups.items()):
    if size == 1:
        print("unique:", key)

by_grade = Counter(grade for grade, area in records)
print(min(by_grade.values()))

# Output:
# 9 records, 5 groups
# 1
# unique: ('Gr11', 'A')
# unique: ('Gr12', 'A')
# 3

(a) What the output shows. There are 5 groups and the smallest has size 1, so $k = 1$. The two unique records are the Grade 11 student from area A and the Grade 12 student from area A. Anyone who knows that a particular Grade 11 student lives in area A can single out that record and read the answer, although no name appears. Grade and area are quasi-identifiers: ordinary details that identify a person in combination.(a) 输出说明了什么。共有 5 个组,最小的组只有 1 条记录,所以 $k = 1$。两条唯一的记录是来自区域 A 的 11 年级学生和来自区域 A 的 12 年级学生。任何知道某位 11 年级学生住在区域 A 的人,都能挑出那条记录并读到答案,尽管上面没有姓名。年级和区域是准标识符(quasi-identifier):单个看似普通、组合起来却能识别个人的细节。

(b) A fix and its cost. Publish only the grade, and drop the area. Every grade then has 3 records, so $k = 3$: each person hides among at least 3. The cost is less detail for the researchers, which is the usual trade-off between privacy and usefulness. Better still, apply data minimisation first: if the survey question does not need the home area, do not collect it.(b) 改进办法及其代价。只发布年级,去掉区域。这样每个年级都有 3 条记录,$k = 3$:每个人至少隐藏在 3 个人之中。代价是研究者得到的细节变少,这正是隐私与实用性之间常见的权衡。更好的做法是先应用数据最小化:如果调查问题不需要居住区域,就不要收集它。

(c) Consent and secondary use. Students agreed to answer a survey for the club. Giving the records to an advertiser or to another organisation would be a secondary use that needs fresh, informed consent. Why this works: counting group sizes turns "is it anonymous?" into a check you can run, and it shows that removing names is not enough.(c) 同意与二次使用。学生同意为社团回答调查。把记录交给广告商或其他机构属于二次使用,需要重新取得知情同意。为什么有效:统计组大小把"它是否匿名"变成了可以运行的检查,并且表明仅仅去掉姓名是不够的。

Which term describes any data that can be used to identify a specific individual (name, email, biometrics)?哪个术语描述可用于识别特定个人的任何数据(姓名、电子邮件、生物特征)?
§4 · Q1
Personally identifiable information (PII)个人可识别信息(PII)
Metadata元数据
Big data大数据
Ciphertext密文
PII (Personally Identifiable Information) is any data that alone or in combination can identify a specific person. It is the core concept in privacy law and the primary target of data breaches. CSTA 3A-IC-29 focuses on automated collection of PII that users may not be aware of.PII(个人可识别信息)是单独或组合可以识别特定人员的任何数据。它是隐私法的核心概念和数据泄露的主要目标。CSTA 3A-IC-29 侧重于用户可能不知道的 PII 自动收集。
Metadata = data about data (e.g., file creation date). Big data = very large datasets. Ciphertext = encrypted data. PII is the term for identifiable personal information.元数据 = 关于数据的数据(如文件创建日期)。大数据 = 非常大的数据集。密文 = 加密数据。PII 是可识别个人信息的术语。
A company collects customer purchase history for billing, then sells it to advertisers without telling customers. What ethical principle does this violate?一家公司收集客户购买历史用于账单,然后在未告知客户的情况下将其出售给广告商。这违反了什么伦理原则?
§4 · Q2
Encryption policy加密政策
Password complexity rules密码复杂性规则
Data minimisation数据最小化
Informed consent and prohibition on secondary use without consent知情同意和禁止未经同意的二次使用
Informed consent requires that users know and agree to how their data will be used. Selling purchase data to advertisers without disclosure is unauthorized secondary use; the data was collected for billing, not advertising. CSTA 3A-IC-30 evaluates the "social and economic implications of privacy."知情同意要求用户了解并同意其数据的使用方式。未经披露将购买数据出售给广告商是未授权的二次使用,数据是为账单收集的,而非广告。CSTA 3A-IC-30 评估"隐私的社会和经济影响"。
This is about informed consent for data use, not encryption, passwords, or data volume. The violation is using data for a purpose the customer never agreed to.这是关于数据使用的知情同意,而非加密、密码或数据量。违规在于将数据用于客户从未同意的目的。
Exam tip考试提示

Command words: evaluate and justify ask for a named principle plus the evidence: "this violates data minimisation because a flashlight does not need contacts", not "it is bad for privacy". Common errors: saying data is anonymous because the name was removed, treating "I agree" on a long terms page as informed consent, and thinking PII is only a name or an ID number.

指令词:evaluate(评估)和 justify(说明理由)要求写出具体的原则加上证据:"这违反了数据最小化,因为手电筒不需要联系人",而不是"这对隐私不好"。常见错误:因为去掉了姓名就说数据是匿名的,把长篇条款页面上的"我同意"当作知情同意,以及认为 PII 只有姓名或证件号码。

Check your understanding自我检测
Which of these identify a person: a student number, a favourite colour, a home address, a photo of a face?下列哪些能识别一个人:学号、最喜欢的颜色、家庭住址、一张面部照片?

The student number, the home address and the face photo can each identify a person, so they are PII. A favourite colour does not identify anyone alone, but it can help single someone out when combined with other details such as grade and area.

学号、家庭住址和面部照片各自都能识别一个人,因此属于 PII。最喜欢的颜色单独不能识别任何人,但与年级、区域等其他细节组合时,可以帮助把某个人挑出来。

A fitness app records your location every minute, even when you are not exercising, and shares it with partners. Evaluate this.某健身应用每分钟记录一次你的位置,即使你没有在运动,并且与合作伙伴共享。评估这种做法。

It breaks data minimisation: location while not exercising is not needed for the stated purpose. Sharing with partners is a secondary use that needs clear, informed consent. Sensitive patterns, such as where someone lives and sleeps, can be read from location data.

这违反了数据最小化:不运动时的位置对既定目的并无必要。与合作伙伴共享属于二次使用,需要清楚的知情同意。位置数据还会暴露敏感的规律,例如某人住在哪里、在哪里睡觉。

In Worked Example 8, what is the smallest group size if the club publishes grade only? If it publishes grade and area?在例题 8 中,如果社团只发布年级,最小的组有多大?如果发布年级和区域呢?

Grade only: each grade has 3 records, so the smallest group is 3. Grade and area: the smallest group is 1, so two students are unique. Fewer details mean larger groups and better privacy.

只发布年级:每个年级有 3 条记录,最小的组是 3。发布年级和区域:最小的组是 1,所以有两名学生是唯一的。细节越少,组越大,隐私保护越好。

Why do professions such as software engineering publish codes of ethics? Name one principle in the ACM Code.为什么软件工程等职业要发布职业伦理准则?说出 ACM 准则中的一项原则。

Professionals can reach systems and data that ordinary users cannot, so a shared code sets expectations that the access will not be abused and gives people a standard to refer to when they disagree. One ACM principle is to respect privacy (1.6); others include avoiding harm (1.2) and being honest and trustworthy (1.3).

专业人员能够接触普通用户无法接触的系统和数据,所以共同的准则设定了不会滥用这种权限的期望,并在出现分歧时给人们提供可参照的标准。ACM 准则中的一项原则是尊重隐私(1.6);其他还包括避免伤害(1.2)以及诚实可信(1.3)。

Going deeper: surveillance, keystroke logging, and professional ethics深入:监控、键盘记录与职业伦理

Ontario ICS4U D2.1 includes "keystroke logging" as an example ethical issue. A keylogger records every keystroke a user types, capturing passwords, messages, banking details, without the user's knowledge. It is unlawful in many places when installed covertly. ICS4U D2.2 says: "describe the essential elements of a code of ethics for computer programmers (e.g., ACM [Association for Computing Machinery] and IEEE [Institute of Electrical and Electronics Engineers] standards) and explain why there is a need for such a code." The ACM Code of Ethics (2018) includes principles such as "Be honest and trustworthy," "Respect privacy," and "Avoid harm." The IEEE Code of Ethics includes "to protect the privacy of others." These professional codes matter because computing professionals often have access to systems and data that ordinary users do not; the ethical framework is what keeps that privileged access from being abused.安大略 ICS4U D2.1 将"键盘记录"列为伦理问题示例。键盘记录器在用户不知情的情况下记录用户输入的每个按键,捕获密码、消息、银行详细信息。秘密安装时在许多地方是非法的。ICS4U D2.2 要求:"描述计算机程序员职业道德准则的基本要素(如 ACM [计算机协会] 和 IEEE [电气和电子工程师协会] 标准)并解释为何需要此类准则。"ACM 伦理准则(2018)包括"诚实可信"、"尊重隐私"和"避免伤害"等原则。IEEE 伦理准则包括"保护他人隐私"。这些专业准则之所以重要,是因为计算专业人员通常可以访问普通用户无法访问的系统和数据,伦理框架是防止这种特权访问被滥用的保障。


Intellectual Property and Licensing知识产权与许可

Learning objectives学习目标
  • Distinguish copyright, a licence and the public domain.
  • Choose a software licence (proprietary, MIT, GPL or Apache 2.0) for a stated goal.
  • Interpret the Creative Commons elements BY, SA, NC and ND, and CC0.
  • Judge whether a stated use of someone else's work is permitted, needs permission, or raises a fair use or fair dealing question, noting that rules vary by country.
  • Explain how intellectual property law can both encourage and hinder innovation.
  • 区分版权、许可和公有领域。
  • 根据既定目标选择软件许可(专有、MIT、GPL 或 Apache 2.0)。
  • 解读知识共享(Creative Commons)的 BY、SA、NC、ND 元素以及 CC0。
  • 判断对他人作品的某种使用是被允许的、需要许可的,还是涉及合理使用或公平处理(fair dealing)问题,并注意各国规则不同。
  • 解释知识产权法律如何既能促进创新、又可能阻碍创新。
Four IP concepts: know which applies to software.四个知识产权概念:了解哪个适用于软件。
  • Copyright版权: automatic legal protection for original creative works (code, writing, images, music) from the moment of creation. The creator controls copying, distribution, and derivative works. Software is protected by copyright by default. BC CS10 names "copyright and fair use" verbatim.:从创作时起对原创作品(代码、文章、图像、音乐)的自动法律保护。创作者控制复制、分发和衍生作品。软件默认受版权保护。BC CS10 原文命名了"版权和合理使用"。
  • Fair use / fair dealing合理使用 / 公平处理: limited exceptions allowing use of copyrighted material without permission for purposes such as education, criticism, commentary, and parody. Fair use (US) and fair dealing (Canada/UK) have different but related rules. In general, you cannot reproduce an entire copyrighted work and call it education.:允许在未经许可的情况下为教育、批评、评论和模仿等目的使用受版权保护材料的有限例外。合理使用(美国)和公平处理(fair dealing,加拿大/英国)有不同但相关的规则。一般来说,你不能复制整个受版权保护的作品并称之为教育用途。
  • Proprietary (closed-source) software专有(闭源)软件: the source code is kept secret; users may only use the software under the terms of a licence (often "install on one machine, no redistribution, no modification"). Examples: Microsoft Windows, Adobe Photoshop. Ontario ICS4U D2.1 lists "software piracy" as an ethical issue; piracy means using proprietary software without a valid licence.:源代码保密;用户只能在许可条款下使用软件(通常是"在一台机器上安装,不得再发行,不得修改")。示例:Microsoft Windows、Adobe Photoshop。安大略 ICS4U D2.1 将"软件盗版"列为伦理问题,盗版意味着在没有有效许可的情况下使用专有软件。
  • Open-source software开源软件: source code is publicly available; users can read, modify, and distribute it under the terms of an open-source licence. Key licences: MIT (permissive: do almost anything, just credit the author), GPL (copyleft: if you distribute a derivative, it must be offered under the GPL too), Apache 2.0 (permissive with patent clause). CSTA 3A-IC-28: "Explain the beneficial and harmful effects that intellectual property laws can have on innovation.":源代码公开可用;用户可以在开源许可条款下阅读、修改和分发它(open source,开源)。主要许可:MIT(宽松:几乎可以做任何事,只需注明作者)、GPL(著佐权,分发衍生作品时也必须以 GPL 提供)、Apache 2.0(带专利条款的宽松)。CSTA 3A-IC-28:"解释知识产权法律对创新可能产生的有益和有害影响。"
Exam distinction: open-source is not the same as free (as in price); open-source means the source code is available. Proprietary software can be free-as-in-price (freeware) but still restrict modification and redistribution.考试区别:开源不等同于免费(价格),开源意味着源代码可用。专有软件可以是免费的(免费软件),但仍然限制修改和再发行。
Worked Example 9: Proprietary vs open-source tradeoffs例题 9:专有与开源的权衡

CSTA 3A-IC-28 asks you to evaluate both beneficial and harmful effects of IP laws on innovation. Both models have real advantages and disadvantages.CSTA 3A-IC-28 要求你评估知识产权法律对创新的有益和有害影响。两种模式都有真实的优势和劣势。

Aspect方面 Proprietary专有 Open Source开源
Who can see the code?谁能看到代码? Only the company仅公司内部 Anyone任何人
Security model安全模型 Security through obscurity (flaws hidden, but so are patches)通过隐蔽实现安全(缺陷隐藏,但补丁也隐藏) Open peer review finds flaws fast; fixes are public too公开同行评审快速发现缺陷;修复也是公开的
Innovation创新 Company controls roadmap; revenue funds R&D公司控制路线图;收入资助研发 Community-driven; forks enable rapid experimentation社区驱动;分支实现快速实验
Cost to user用户成本 Licence fee (or subscription)许可费(或订阅费) Usually free; cost is in support/customisation通常免费;成本在于支持/定制
IP law effect知识产权法律影响 Copyright enables the business model; can stifle competition版权支撑商业模式;可能抑制竞争 Licences use copyright law to enforce openness (copyleft)许可利用版权法强制开放性(著佐权)
Worked Example 10: Choosing a licence and reading permissions例题 10:选择许可并解读授权

Four situations involve other people's work or your own. For each, say who holds the copyright, what permission applies, and what to do. (a) A student's library to be reused with credit. (b) A team that wants changes shared. (c) A CC BY-NC-SA photo for a ticketed concert poster. (d) A 19th-century novel.四种情形涉及他人的作品或你自己的作品。对每一种,说明谁持有版权、适用什么许可,以及应该怎么做。(a) 一名学生希望署名即可复用的代码库。(b) 一个希望改动被共享的团队。(c) 一张 CC BY-NC-SA 的照片,要用于售票音乐会海报。(d) 一部 19 世纪的小说。

First, three ideas that are often mixed up. Copyright is the automatic legal right of the creator. A licence is the creator's written permission, with conditions; it works because the creator holds the copyright. Public domain means no copyright applies, either because it has expired or because the creator gave it up (for example with CC0, a dedication to the public domain as far as the law allows). Copyright terms and the exact rules differ by country, so check the local rules for a real case.先分清三个常被混淆的概念。版权是创作者自动享有的法律权利。许可(licence)是创作者附带条件的书面许可;它之所以有效,是因为创作者持有版权。公有领域(public domain)是指不再适用版权,原因可能是保护期已满,也可能是创作者放弃了权利(例如 CC0,在法律允许的范围内向公有领域的贡献)。各国的版权期限和具体规则不同,遇到真实案例要查当地规定。

(a) A student writes a small Python library and wants anyone, including companies, to reuse it if they credit her. Use a permissive licence such as MIT. It allows use, modification and redistribution, even inside proprietary products, as long as the copyright notice stays.(a) 一名学生写了一个小型 Python 库,希望任何人(包括公司)只要署名就可以重复使用。使用 MIT 这样的宽松许可。只要保留版权声明,就允许使用、修改和再分发,甚至可以用在专有产品里。

(b) A team wants anyone who ships a modified version to share their changes on the same terms. Use a copyleft licence such as the GPL. If you distribute a modified version, you must offer it under the GPL too. Modifying it privately and never distributing it does not trigger that duty (some network-service licences differ, so read the text).(b) 一个团队希望任何发布修改版的人都以相同条款共享其改动。使用 GPL 这样的著佐权(copyleft)许可。如果你分发修改版,就必须同样在 GPL 下提供。只在私下修改而从不分发,不会触发这项义务(一些网络服务类许可不同,需阅读许可文本)。

(c) A club wants to put a classmate's photo, published under CC BY-NC-SA, on a poster advertising a ticketed concert. Read each element. BY: credit the creator. NC: non-commercial use only; advertising a ticketed event is very likely commercial, so the club needs permission or another photo. SA: if you adapt the photo, share the result under the same licence. Whether a use is "non-commercial" depends on the licence text, so when in doubt, ask the creator.(c) 一个社团想把同学以 CC BY-NC-SA 发布的照片用在售票音乐会的海报上。逐项阅读。BY:署名创作者。NC:仅限非商业用途;为售票活动做宣传很可能属于商业用途,所以社团需要取得许可或换一张照片。SA:如果改编照片,成果要以相同许可共享。某种用途是否算"非商业"取决于许可文本,有疑问时要询问创作者。

(d) A 19th-century novel. In many countries its copyright term has ended, so the text is in the public domain and may be copied and shared freely. A modern edition can still carry new copyright in its introduction, notes, translation or layout, and the term that applies depends on the country.(d) 一部 19 世纪的小说。在许多国家,其版权期限已经届满,文本属于公有领域,可以自由复制和分享。现代版本的导言、注释、译文或排版仍可能有新的版权,具体适用的期限取决于国家。

Why this works. In each case ask the same three questions: who holds the copyright, what permission has been given (a licence, or none), and what conditions come with it. Other Creative Commons elements follow the same logic: ND (no derivatives) allows sharing the work unchanged only.为什么有效。每种情况都问同样的三个问题:谁持有版权,已经给予了什么许可(某个许可,或没有),附带什么条件。其他知识共享(Creative Commons)元素遵循同样的逻辑:ND(禁止演绎)只允许原样分享作品。

A student copies and uses a piece of software without purchasing a licence. What term best describes this action?一名学生在未购买许可的情况下复制并使用一款软件。哪个术语最能描述这种行为?
§5 · Q1
Fair use合理使用
Software piracy软件盗版
Open-source use开源使用
Data minimisation数据最小化
Software piracy is using proprietary software without a valid licence. It violates copyright law. Ontario ICS4U D2.1 lists "software piracy" as an ethical issue for computing students to analyse. Note: using open-source software under its licence is not piracy.软件盗版是在没有有效许可的情况下使用专有软件。这违反了版权法。安大略 ICS4U D2.1 将"软件盗版"列为计算机学生分析的伦理问题。注意:在其许可下使用开源软件不是盗版。
Fair use applies to limited educational/critical use of copyrighted content, not copying whole programs. Open-source software has its own licence permitting use. What's described is software piracy.合理使用适用于对受版权保护内容的有限教育/批评性使用,而非复制整个程序。开源软件有自己的允许使用的许可。所描述的是软件盗版。
Which open-source licence requires that any modified version of the software must also be released under the same open-source terms?哪种开源许可要求软件的任何修改版本也必须在相同的开源条款下发布?
§5 · Q2
MIT licenceMIT 许可
Apache 2.0 licenceApache 2.0 许可
GPL (GNU General Public Licence)GPL(GNU 通用公共许可)
Freeware licence免费软件许可
GPL is a copyleft licence: any derivative work must also be distributed under the GPL. This "viral" property ensures that open-source software stays open. MIT and Apache 2.0 are permissive licences; they allow the code to be used in proprietary products without requiring the result to be open-source.GPL 是一种著佐权许可:任何衍生作品也必须在 GPL 下分发。这种"传染性"属性确保开源软件保持开放。MIT 和 Apache 2.0 是宽松许可,它们允许代码用于专有产品,而无需要求结果是开源的。
MIT = permissive (do almost anything). Apache 2.0 = permissive with patent clause. GPL = copyleft (derivatives must stay open). Freeware = free of charge but not necessarily open-source.MIT = 宽松(几乎可以做任何事)。Apache 2.0 = 带专利条款的宽松。GPL = 著佐权(衍生作品必须保持开放)。免费软件 = 免费但不一定是开源的。
Exam tip考试提示

Command words: distinguish needs a difference for each pair (copyright is the right, a licence is the permission, public domain is no right); justify a licence choice by tying it to the goal (reuse with credit points to MIT, keeping changes open points to GPL). Common errors: saying open source means no copyright (the licence depends on copyright), believing a work with no © symbol is free to use, and saying fair use covers any educational use. Say which country's rule you mean.

指令词:distinguish(区分)需要对每一对概念给出区别(版权是权利,许可是授权,公有领域是没有权利);justify(说明理由)选择某种许可时,要把它与目标联系起来(署名即可复用指向 MIT,保持改动开放指向 GPL)。常见错误:说开源就是没有版权(许可依赖于版权),认为没有 © 符号的作品就可以随便使用,以及说合理使用涵盖任何教育用途。要说明你指的是哪个国家的规则。

Check your understanding自我检测
Why does open-source software depend on copyright law?为什么开源软件依赖版权法?

The creator holds the copyright, and an open-source licence is the creator's grant of permissions with conditions. Without the creator's exclusive rights there would be nothing to grant, and copyleft conditions such as sharing changes would have no legal force.

创作者持有版权,开源许可是创作者附带条件地授予的权限。没有创作者的专有权利,就没有可授予的东西,诸如共享改动之类的著佐权条件也就没有法律效力。

You find a photo licensed CC BY-ND. May you crop it for your presentation?你找到一张采用 CC BY-ND 许可的照片。可以为演示文稿裁剪它吗?

BY means you must credit the creator. ND (no derivatives) means you may share the work unchanged only. Cropping or editing usually creates an adaptation, so use the photo as published with credit, or ask the creator. The licence text is the final authority.

BY 表示必须署名创作者。ND(禁止演绎)表示只能原样分享作品。裁剪或编辑通常会产生演绎作品,所以应按原样使用并署名,或询问创作者。许可文本才是最终依据。

Give one beneficial and one harmful effect that IP law can have on innovation.给出知识产权法律对创新的一项有益影响和一项有害影响。

Beneficial: a patent or copyright lets creators earn from their work, which pays for the effort of inventing. Harmful: a broad patent can block competitors from using a widely needed technique for years, and strict licences can stop others from building on existing work.

有益:专利或版权让创作者能从作品中获利,补偿其创造的投入。有害:范围过宽的专利可能多年阻止竞争对手使用广泛需要的技术,过严的许可也可能阻止他人在现有作品上继续创作。

A website is free to read. Does that mean you may copy its articles into your own blog?某网站可以免费阅读。这是否意味着你可以把它的文章复制到自己的博客上?

No. Free to view is not free to reuse. Copyright still applies unless the site grants a licence that allows copying, so check for one. A short quotation with credit may fall under fair use or fair dealing, but copying whole articles generally does not.

不是。可免费查看不等于可自由复用。除非网站授予了允许复制的许可,版权仍然适用,所以要查看是否有这样的许可。署名的简短引用可能属于合理使用或公平处理,但复制整篇文章通常不属于。


Computing's Impact on Society计算对社会的影响

Learning objectives学习目标
  • Describe the impact of a computing innovation: a beneficial effect, a harmful effect and who is affected by each.
  • Calculate the time saved by automating a task and say what the number leaves out.
  • Explain the digital divide and give two factors that cause it.
  • Analyse how automation affects workers, users and communities differently.
  • 描述一项计算创新的影响:一个有益影响、一个有害影响,以及各自影响的人群。
  • 计算自动化某项任务所节省的时间,并说明这个数字没有涵盖什么。
  • 解释数字鸿沟,并给出造成它的两个因素。
  • 分析自动化对劳动者、用户和社区的影响有何不同。
Five impact dimensions: know a concrete example for each.五个影响维度:每个都了解一个具体例子。
  • Automation and employment自动化与就业: computing automates repetitive tasks (assembly lines, data entry, customer service bots), eliminating some jobs while creating new ones (ML engineers, data analysts). AP CSP Topic 5.1 "Beneficial and Harmful Effects": the same innovation can benefit some people and harm others.:计算自动化重复性任务(装配线、数据录入、客服机器人),消除一些工作同时创造新工作(机器学习工程师、数据分析师)。AP CSP 主题 5.1"有益和有害影响":同一创新可以造福某些人同时伤害另一些人。
  • Digital divide数字鸿沟: the gap between those who have access to computing resources and the internet and those who do not. Affects individuals (rural vs urban, rich vs poor) and nations. AP CSP Topic 5.2: the digital divide can reduce opportunities for those who are on the wrong side of it. BC CS10 names "digital divide" verbatim.:有计算资源和互联网访问权限与没有访问权限的人之间的差距(digital divide,数字鸿沟)。影响个人(农村与城市、富与穷)和国家。AP CSP 主题 5.2:数字鸿沟可能减少处于不利一侧的人的机会。BC CS10 原文命名了"数字鸿沟"。
  • Global communication and social media全球通信与社交媒体: computing enables instant global communication, collaborative work across time zones, and social movements. Downside: misinformation spreads at scale; cyberbullying; filter bubbles that reinforce existing beliefs. BC CS10 lists "global communication, social media, e-commerce" as impacts.:计算实现即时全球通信、跨时区协作工作和社会运动。缺点:错误信息大规模传播;网络欺凌;强化现有信念的过滤泡沫。BC CS10 将"全球通信、社交媒体、电子商务"列为影响。
  • E-commerce and the economy电子商务与经济: online retail, digital payments, and gig-economy platforms have transformed how goods and services are bought and sold. Winner-takes-all dynamics in tech markets create monopoly risks. CSTA 3A-IC-24: "Evaluate the ways computing impacts personal, ethical, social, economic, and cultural practices.":网络零售、数字支付和零工经济平台改变了商品和服务的买卖方式。科技市场中的赢者通吃动态创造了垄断风险。CSTA 3A-IC-24:"评估计算影响个人、伦理、社会、经济和文化实践的方式。"
  • Healthcare, science, and public good医疗保健、科学与公共利益: computing enables genomic sequencing, climate modelling, medical imaging, and drug discovery at speeds impossible without it. These are the clearest beneficial effects. AP CSP Skill 5.C: "Describe the impact of a computing innovation.":计算以没有它不可能实现的速度实现基因组测序、气候建模、医学成像和药物发现。这些是最明显的有益影响。AP CSP 技能 5.C:"描述计算创新的影响。"
Ontario ICS4U D3 says: "analyse the impact of emerging computer technologies on society and the economy." This entire section maps directly.安大略 ICS4U D3 要求:"分析新兴计算机技术对社会和经济的影响。"本节完全直接对应。
Worked Example 11: Applying AP CSP Skill 5.C to a specific innovation例题 11:将 AP CSP 技能 5.C 应用于具体创新

AP CSP Skill 5.C: "Describe the impact of a computing innovation." Practice format: state the innovation, describe at least one beneficial effect and one harmful effect, and identify who is affected.AP CSP 技能 5.C:"描述计算创新的影响。"练习格式:陈述创新,描述至少一个有益影响和一个有害影响,并识别受影响的人。

Innovation: GPS navigation apps (e.g., Google Maps, Apple Maps).创新:GPS 导航应用(如 Google Maps、Apple Maps)。

Beneficial effects:有益影响: Can help reduce traffic accidents (real-time routing avoids congestion and some dangerous roads). Enabled gig-economy delivery work for people without specialised skills. Made navigation accessible to people with visual impairments (voice-guided turn-by-turn). Reduced fuel consumption through optimal routing.有助于减少交通事故(实时路线规划可避开拥堵和部分危险路段)。为没有专业技能的人提供零工经济送货工作。通过语音引导逐步导航使视力障碍者能够导航。通过优化路线减少燃料消耗。

Harmful effects:有害影响: Tracking: location data collected by the app reveals patterns of movement, religious attendance, political activity, medical appointments: all potentially sensitive. This data may be sold to brokers or subpoenaed by governments. Over-reliance: cognitive atrophy in spatial reasoning as people stop internalising maps. Economic displacement: taxi and local guide industries were disrupted by navigation + ride-sharing apps.跟踪:应用收集的位置数据揭示了移动模式、宗教出勤、政治活动、医疗预约,所有这些都可能敏感。这些数据可能被出售给经纪人或被政府传唤。过度依赖:随着人们停止内化地图,空间推理能力退化。经济置换:出租车和当地导游行业被导航+拼车应用打乱。

Who is affected:受影响的人: Beneficial to: commuters, delivery workers, people with disabilities, tourists. Harmful to: taxi drivers, privacy-conscious users, people in surveillance-heavy regimes. The harm is not evenly distributed; those with less power to protect their data or change jobs are most vulnerable.受益者:通勤者、送货工人、残障人士、游客。受害者:出租车司机、注重隐私的用户、监控严密国家的人。伤害分布不均,那些保护数据或换工作能力较弱的人最脆弱。

Worked Example 12: Time saved by automation and who is affected例题 12:自动化节省的时间与受影响的人

A school adopts a tool that checks weekly coding quizzes. Teachers used to check 400 quizzes a week at 12 minutes each; with the tool, each takes 1.5 minutes including a quick teacher glance. (a) Calculate the weekly hours before and after, and the time saved. (b) Describe the beneficial and harmful effects and say who is affected.一所学校采用了一个检查每周编程小测的工具。过去教师每周要检查 400 份小测,每份 12 分钟;使用工具后,每份(包括教师快速看一眼)需要 1.5 分钟。(a) 计算使用前后的每周小时数以及节省的时间。(b) 描述有益和有害的影响,并说明受影响的人。

(a) The numbers. Before: $400 \times 12 = 4800$ minutes $= 80$ hours per week. After: $400 \times 1.5 = 600$ minutes $= 10$ hours per week. Time saved: $80 - 10 = 70$ hours per week. The new workload is $10 / 80 = 0.125$, one eighth of the old.(a) 数字。使用前:$400 \times 12 = 4800$ 分钟 $= 80$ 小时每周。使用后:$400 \times 1.5 = 600$ 分钟 $= 10$ 小时每周。节省时间:$80 - 10 = 70$ 小时每周。新的工作量为 $10 / 80 = 0.125$,是原来的八分之一。

(b) Beneficial effects. Students get feedback sooner, and teachers can spend the 70 hours on one-to-one help, planning or other tasks. Who benefits: students and teachers.(b) 有益影响。学生更快得到反馈,教师可以把这 70 小时用在一对一辅导、备课或其他工作上。受益者:学生和教师。

(c) Harmful effects. The tool may reject unusual but correct answers, so students whose solutions differ from the expected pattern are treated unfairly. It collects each student's work, which raises a privacy question about storage and secondary use. Teaching assistants whose hours came from checking work may lose them. Students without a device or connection at home may be unable to use any part that needs one, which widens the digital divide. Who is harmed: those with unusual solutions, those without access, and assistants.(c) 有害影响。工具可能拒绝不常见但正确的答案,使解法与预期模式不同的学生受到不公平对待。它会收集每名学生的作业,这带来了存储与二次使用的隐私问题。原本靠检查作业获得工时的助教可能失去这些工时。家里没有设备或网络的学生可能无法使用需要它们的部分,这会扩大数字鸿沟。受害者:解法不寻常的学生、无法接入的学生和助教。

(d) Judgement. The number 70 hours is real but incomplete: it counts time, not fairness, privacy or jobs. A balanced recommendation keeps a human check for disputed results, limits what data is stored, and provides school devices for those who lack them. Why this works: the template (innovation, benefit, harm, who is affected) forces both sides and the people behind the numbers into the answer.(d) 判断。70 小时这个数字是真实的,但并不完整:它只统计时间,没有统计公平、隐私或就业。平衡的建议是:对有争议的结果保留人工复核,限制存储的数据,并为缺少设备的学生提供学校设备。为什么有效:这个模板(创新、益处、危害、受影响的人)迫使答案同时包含两面和数字背后的人。

The "digital divide" refers to which of the following?"数字鸿沟"指的是以下哪项?
§6 · Q1
The technical difference between analogue and digital signals模拟信号和数字信号之间的技术差异
The gap between the number of male and female programmers男女程序员数量之间的差距
The gap between those who have access to computing resources and those who do not有计算资源访问权限与没有访问权限的人之间的差距
The split between open-source and proprietary software markets开源和专有软件市场之间的分割
The digital divide is the social and economic inequality between those with access to digital technology (computers, internet) and those without. AP CSP Topic 5.2 covers how this divide can reduce opportunities for those on the wrong side of it. BC CS10 names it verbatim.数字鸿沟是有数字技术(计算机、互联网)访问权限和没有访问权限的人之间的社会经济不平等。AP CSP 主题 5.2 涵盖了这种鸿沟如何减少处于不利一侧的人的机会。BC CS10 原文命名了它。
The digital divide is specifically about unequal access to digital technology, not signal types, gender ratios, or software market splits.数字鸿沟特指对数字技术的不平等访问,而非信号类型、性别比例或软件市场分割。
AP CSP Topic 5.1 focuses on "Beneficial and Harmful Effects." Which of the following best demonstrates that the SAME computing innovation can have both types of effects?AP CSP 主题 5.1 关注"有益和有害影响"。以下哪项最能说明同一计算创新可以同时产生两种影响?
§6 · Q2
GPS apps help commuters navigate safely but collect location data that can be used for surveillanceGPS 应用帮助通勤者安全导航,但收集可用于监控的位置数据
Software updates fix bugs but also introduce new features软件更新修复错误,但也引入新功能
Open-source software is free, but proprietary software costs money开源软件是免费的,但专有软件需要花钱
Encryption protects data in transit and also protects data at rest加密保护传输中的数据,也保护静态数据
GPS navigation has clear beneficial effects (safety, accessibility, efficiency) and clear harmful effects (location surveillance, privacy loss, displacement of taxi drivers). The same technology causing opposite outcomes for different stakeholders is exactly what AP CSP Topic 5.1 covers.GPS 导航有明显的有益效果(安全、可访问性、效率)和明显的有害效果(位置监控、隐私损失、出租车司机被取代)。同一技术对不同利益相关者产生相反结果,正是 AP CSP 主题 5.1 所涵盖的内容。
The other options describe trade-offs or choices, not beneficial + harmful effects from the same innovation on different stakeholders. GPS is the clearest example of dual impact.其他选项描述的是权衡或选择,而非同一创新对不同利益相关者的有益+有害影响。GPS 是双重影响最清晰的例子。
Exam tip考试提示

Command words: describe needs the innovation, a benefit, a harm and the people affected on each side; analyse adds why the effects differ between groups. Common errors: listing only benefits, calling technology "neutral" instead of naming who gains and who loses, mixing up the digital divide with an age gap, and giving a number without its unit (hours per week, not just 70).

指令词:describe(描述)需要写出创新本身、一项益处、一项危害,以及双方各自影响的人;analyse(分析)还要说明不同群体受到的影响为何不同。常见错误:只列出益处,把技术说成"中立"而不指出谁受益、谁受损,把数字鸿沟与年龄差距混为一谈,以及只给数字而不带单位(是每周 70 小时,不是单独的 70)。

Check your understanding自我检测
Give two factors that create a digital divide.给出造成数字鸿沟的两个因素。

For example the cost of devices and data plans, a lack of broadband infrastructure in rural or remote areas, limited digital skills, and websites or apps that are not accessible to people with disabilities. Any two, with a brief reason each.

例如设备和流量套餐的费用、农村或偏远地区缺乏宽带基础设施、数字技能有限,以及对残障人士不友好的网站或应用。任选两个并各给简短理由即可。

In Worked Example 12, half of the saved time goes to one-to-one help at 15 minutes per student. How many students a week is that?在例题 12 中,节省的时间有一半用于一对一辅导,每名学生 15 分钟。每周可以辅导多少名学生?

Half of 70 hours is 35 hours, which is $35 \times 60 = 2100$ minutes. Then $2100 / 15 = 140$ students per week.

70 小时的一半是 35 小时,即 $35 \times 60 = 2100$ 分钟。于是 $2100 / 15 = 140$ 名学生每周。

Why is the harm from a navigation app not spread evenly?为什么导航应用造成的危害不是均匀分布的?

People differ in power and options. A taxi driver whose work is disrupted, or a person whose location history could be sold or demanded by an authority, has less ability to avoid the harm than a tourist who simply benefits. The same innovation therefore helps some groups and harms others.

人们拥有的权力和选择各不相同。工作受到冲击的出租车司机,或位置历史可能被出售或被当局索取的人,比单纯受益的游客更难避开危害。因此同一项创新对一些群体有益,对另一些群体有害。


Bias, Accessibility and Sustainability偏见、可访问性与可持续性

Learning objectives学习目标
  • Name three sources of algorithmic bias (training data, feature selection, team composition) and give an example of each.
  • Compute error rates per group and explain why an overall rate can hide a gap.
  • Suggest a test or a fix that reduces bias.
  • Match accessibility features to the need each one meets.
  • Estimate a device's energy use and name two ways to reduce computing's environmental footprint.
  • 说出算法偏见的三个来源(训练数据、特征选择、团队构成),并各举一个例子。
  • 计算各组的错误率,并解释为什么总体错误率可能掩盖差距。
  • 提出能减少偏见的测试或改进措施。
  • 把无障碍功能与它所满足的需求对应起来。
  • 估算设备的能耗,并说出减少计算环境足迹的两种办法。
Three emerging challenges: know a concrete example for each.三个新兴挑战:每个都了解一个具体例子。
  • Algorithmic bias算法偏见: when a system produces systematically unfair outcomes for some groups. Causes: biased training data (historical discrimination encoded into data), biased feature selection, lack of diverse development teams. Example: facial recognition systems with higher error rates for darker-skinned faces because training data was predominantly light-skinned. CSTA 3A-IC-25: "Test and refine computational artifacts to reduce bias and equity deficits." AP CSP Topic 5.3: "Computing Bias.":当系统对某些群体产生系统性不公平结果时(algorithmic bias,算法偏见)。原因:有偏见的训练数据(历史歧视编码进数据)、有偏见的特征选择、缺乏多元化的开发团队。例子:面部识别系统对深色皮肤面孔错误率更高,因为训练数据以浅色皮肤为主。CSTA 3A-IC-25:"测试和改进计算制品以减少偏见和公平赤字。" AP CSP 主题 5.3:"计算偏见。"
  • Accessibility可访问性: designing computing systems that can be used by people with a wide range of abilities, including those with visual, auditory, motor, or cognitive disabilities. Examples: screen readers (for blindness), captions (for deafness), keyboard navigation (for motor impairment), high-contrast themes (for low vision). BC CS10: "technology to assist people with diverse abilities" and "impacts of technology use on personal health and wellness." CSTA 3A-AP-21: "Evaluate and refine computational artifacts to make them more usable and accessible.":设计可供各种能力的人使用的计算系统,包括视觉、听觉、运动或认知障碍人士(accessibility,可访问性)。例子:屏幕阅读器(用于盲人)、字幕(用于聋人)、键盘导航(用于运动障碍)、高对比度主题(用于低视力)。BC CS10:"辅助多元能力人群的技术"和"技术使用对个人健康和健康的影响"。CSTA 3A-AP-21:"评估和改进计算制品,使其更易用、更易访问。"
  • Environmental sustainability环境可持续性: computing has a significant environmental footprint: data centres consume roughly 1% of global electricity (estimates vary); cryptocurrency mining is energy-intensive; electronic waste (e-waste) contains toxic materials that pollute when improperly discarded. Green computing strategies include energy-efficient hardware, renewable-powered data centres, extending device lifespans, and responsible e-waste recycling. Ontario ICS3U D1.1 (verbatim): "describe the negative effects of computer use on the environment (e.g., creation of e-waste …) and on human health." BC CS10: "e-waste, recycling, conflict mineral exploitation" and "power consumption, renewable energy, server farms.":计算具有显著的环境足迹:数据中心消耗全球约 1% 的电力(估计值因来源而异);加密货币挖矿能源密集;电子废物(e-waste,电子废物)含有有毒物质,不当丢弃会造成污染。绿色计算策略包括节能硬件、使用可再生能源的数据中心、延长设备寿命和负责任的电子废物回收(sustainability,可持续性)。安大略 ICS3U D1.1(原文):"描述计算机使用对环境(如产生电子废物……)和人类健康的负面影响。" BC CS10:"电子废物、回收利用、冲突矿产开采"和"能耗、可再生能源、服务器农场"。
These three challenges connect to AP CSP Big Idea 5 (the digital divide is Topic 5.2 and bias is Topic 5.3; sustainability is not a named topic there) and to BC CS10's broad sustainability strand. Ontario's D1 expectations state environmental stewardship explicitly.这三个挑战与 AP CSP 大概念 5 相关(数字鸿沟是主题 5.2,偏见是主题 5.3;可持续性不是其中的独立主题),也与 BC CS10 的广泛可持续性内容相关。安大略 D1 的期望明确提出了环境管理。
Worked Example 13: Sources of bias in AI systems例题 13:AI 系统中偏见的来源

AP CSP Topic 5.3 covers how bias enters computing systems and what effects it has. There are three main entry points.AP CSP 主题 5.3 涵盖偏见如何进入计算系统及其影响。有三个主要进入点。

1. Biased training data.1. 有偏见的训练数据。 If a hiring algorithm is trained on historical hiring decisions that favoured one demographic, it learns to reproduce that bias. The algorithm is not "biased" in intent, but the pattern in the data encodes the historical discrimination. Example: Amazon's experimental recruiting tool (discontinued 2018) downgraded resumes mentioning "women's" because the male-dominated tech workforce was overrepresented in its training set.如果招聘算法在历史上偏向某一人口群体的招聘决定上进行训练,它就会学会重现这种偏见。算法在意图上并不"有偏见",但数据中的模式编码了历史歧视。例子:亚马逊的实验性招聘工具(2018 年停用)降低了提及"女性"的简历评分,因为以男性为主的技术劳动力在其训练集中过度代表。

2. Biased feature selection.2. 有偏见的特征选择。 Using a proxy variable that correlates with a protected characteristic introduces indirect bias. Example: using ZIP code as a feature in loan approval correlates with race (due to historical redlining), producing racially discriminatory outcomes without ever including race as a variable.使用与受保护特征相关的代理变量会引入间接偏见。例子:在贷款审批中使用邮政编码作为特征与种族相关(由于历史上的红线政策),在从未将种族列为变量的情况下产生种族歧视性结果。

3. Lack of diversity in development teams.3. 开发团队缺乏多样性。 Homogeneous teams may not notice that their product fails specific user groups. Example: early voice-recognition systems trained primarily on male voices performed poorly for women. CSTA 3A-IC-25 says to "test and refine computational artifacts to reduce bias and equity deficits"; the fix is diverse testing panels and representative datasets.同质化团队可能不会注意到其产品对特定用户群体的失败。例子:主要在男性声音上训练的早期语音识别系统对女性表现不佳。CSTA 3A-IC-25 要求"测试和改进计算制品以减少偏见和公平赤字",解决方案是多样化的测试小组和具有代表性的数据集。

Worked Example 14: Auditing a system for bias例题 14:审查系统是否存在偏见

A face-unlock feature is tested on 1000 photos: 500 of group A and 500 of group B. It wrongly fails on 10 photos of group A and 60 of group B. (a) Compute the overall error rate and each group's rate. (b) Explain why the overall rate misleads. (c) Say how to look for the source and (d) suggest responses.一个人脸解锁功能用 1000 张照片测试:A 组 500 张,B 组 500 张。它在 A 组错误失败 10 张,在 B 组错误失败 60 张。(a) 计算总体错误率和各组错误率。(b) 解释为什么总体错误率会误导人。(c) 说明如何寻找来源,并 (d) 提出应对办法。

Setting. A face-unlock feature is tested on 1000 photos: 500 of group A and 500 of group B. It wrongly fails on 10 photos of group A and 60 of group B. The code computes the overall error rate and the rate for each group.设定。一个人脸解锁功能用 1000 张照片测试:A 组 500 张,B 组 500 张。它在 A 组错误失败 10 张,在 B 组错误失败 60 张。代码计算总体错误率和各组的错误率。

tested = {"group A": (500, 10), "group B": (500, 60)}

total = sum(n for n, errors in tested.values())
total_errors = sum(errors for n, errors in tested.values())
print(total_errors / total)
for name, (n, errors) in tested.items():
    print(name, errors / n)
print((60 / 500) / (10 / 500))

# Output:
# 0.07
# group A 0.02
# group B 0.12
# 6.0

(a) Rates. Overall: $70 / 1000 = 0.07$, which is 7%. Group A: $10 / 500 = 0.02$, which is 2%. Group B: $60 / 500 = 0.12$, which is 12%. Group B fails $0.12 / 0.02 = 6$ times as often.(a) 错误率。总体:$70 / 1000 = 0.07$,即 7%。A 组:$10 / 500 = 0.02$,即 2%。B 组:$60 / 500 = 0.12$,即 12%。B 组的失败频率是 A 组的 $0.12 / 0.02 = 6$ 倍。

(b) Why the overall rate misleads. A single 7% looks acceptable but hides a six-fold gap, because the average mixes a good result with a poor one. Always report the rate per group.(b) 为什么总体错误率会误导人。单独一个 7% 看起来可以接受,却掩盖了六倍的差距,因为平均值把好结果和差结果混在了一起。一定要分别报告每个组的错误率。

(c) Finding the source. The numbers show that bias exists, not why. Check the three entry points: Was one group underrepresented in the training data? Does a feature behave differently for the groups, such as the camera or lighting set-up? Was the test team diverse enough to notice? Test each cause rather than assume one.(c) 找出来源。这些数字说明偏见存在,却没有说明原因。检查三个进入点:训练数据中某个群体是否代表性不足?某个特征对不同群体的表现是否不同,例如摄像头或光线设置?测试团队是否足够多元,能够注意到问题?应逐一检验各种原因,而不是先假定其中一个。

(d) Responses. Add representative training images, set a target that every group must meet before release, retest per group, and offer a fallback such as a PIN so a failure does not lock a person out. Why this works: splitting the results by group turns a vague worry ("is it fair?") into a measurable gap that can be tracked after each fix.(d) 应对办法。增加有代表性的训练图像,规定每个群体在发布前都必须达到的目标,按群体重新测试,并提供 PIN 码等备用方式,使失败不会把人挡在门外。为什么有效:按群体拆分结果,把模糊的担忧("公平吗?")变成可测量的差距,可以在每次改进后持续跟踪。

A facial recognition system works accurately for light-skinned faces but has a much higher error rate for dark-skinned faces. This is an example of what?一个面部识别系统对浅色皮肤面孔准确工作,但对深色皮肤面孔错误率高得多。这是什么的例子?
§7 · Q1
A security vulnerability安全漏洞
Algorithmic bias from unrepresentative training data来自非代表性训练数据的算法偏见
A digital divide issue数字鸿沟问题
A copyright violation版权违规
This is algorithmic bias caused by unrepresentative training data. If the training images were predominantly light-skinned, the model learned features that do not generalise to dark-skinned faces. CSTA 3A-IC-25 and AP CSP Topic 5.3 both address this. The fix: more diverse and representative training datasets.这是由非代表性训练数据引起的算法偏见。如果训练图像主要是浅色皮肤,模型就会学习不能泛化到深色皮肤面孔的特征。CSTA 3A-IC-25 和 AP CSP 主题 5.3 都涉及这一问题。解决方案:更多样化和更具代表性的训练数据集。
This is not a security vulnerability or digital divide or copyright issue. It is algorithmic bias; the system systematically underperforms for a specific demographic group due to how it was trained.这不是安全漏洞、数字鸿沟或版权问题。这是算法偏见,系统由于训练方式对特定人口群体系统性地表现不佳。
Ontario ICS3U strand D1 specifically emphasises which environmental concern related to computing?安大略 ICS3U D1 单元特别强调与计算相关的哪个环境问题?
§7 · Q2
Software piracy软件盗版
Algorithmic bias in AIAI 中的算法偏见
Phishing attacks钓鱼攻击
E-waste and the negative environmental effects of computer use电子废物和计算机使用的负面环境影响
Ontario ICS3U D1.1 (verbatim): "describe the negative effects of computer use on the environment (e.g., creation of e-waste …) and on human health." The environmental stewardship theme recurs in the Ontario ICS courses.安大略 ICS3U D1.1(原文):"描述计算机使用对环境(如产生电子废物……)和人类健康的负面影响。"环境管理主题在安大略 ICS 课程中反复出现。
Software piracy and phishing are listed under D2 (ethics), and algorithmic bias is a separate topic. The D1 theme is specifically environmental sustainability and e-waste.软件盗版和钓鱼列在 D2(伦理)中,算法偏见是另一个主题。D1 主题专门是环境可持续性和电子废物。
Exam tip考试提示

Command words: explain a bias by naming its source (training data, feature selection or team composition) and the effect, not just "the system is biased"; suggest a fix that matches the source. Common errors: believing an algorithm cannot be biased because it is only maths, quoting a single overall accuracy as proof of fairness, and treating accessibility as a feature only for a few users. For sustainability, give a number with units (kWh) when you can.

指令词:explain(解释)一种偏见时,要指出它的来源(训练数据、特征选择或团队构成)及其效果,而不是只说"系统有偏见";suggest(提出)与来源相匹配的改进办法。常见错误:认为算法只是数学所以不可能有偏见,用单一的总体准确率来证明公平,以及把无障碍当作只服务少数用户的功能。谈可持续性时,尽量给出带单位(kWh)的数字。

Check your understanding自我检测
A delivery-time predictor uses the customer's postcode as an input, and customers in some areas get systematically longer estimates. Which source of bias is this?某送货时间预测器把顾客的邮政编码作为输入,结果某些地区的顾客总是得到更长的估计时间。这属于哪种偏见来源?

Feature selection. The postcode acts as a proxy for other things, such as past road quality or past data volume, so the model treats whole areas unequally even though no one chose to. Test the predictor's results per area and review whether the feature is justified.

特征选择。邮政编码充当了其他因素的代理变量,例如过去的道路状况或历史数据量,所以即使没有人刻意为之,模型也会对整个地区区别对待。应按地区检验预测结果,并复核该特征是否合理。

Match each need to a feature: low vision, deafness, motor impairment, blindness.把每种需求与相应的功能对应起来:低视力、失聪、运动障碍、失明。

Low vision: high-contrast themes and zoom. Deafness: captions and transcripts. Motor impairment: full keyboard navigation or voice control. Blindness: screen reader support, which needs text alternatives (alt text) on images.

低视力:高对比度主题和缩放。失聪:字幕和文字记录。运动障碍:完整的键盘导航或语音控制。失明:屏幕阅读器支持,这需要为图像提供文字替代(alt 文本)。

A laptop uses 60 W for 8 hours a day on 200 days a year. How many kWh is that?一台笔记本电脑每天以 60 W 的功率工作 8 小时,一年 200 天。共多少千瓦时(kWh)?

$60 \times 8 \times 200 = 96{,}000$ watt-hours, which is $96$ kWh. Dividing by 1000 converts watt-hours to kilowatt-hours.

$60 \times 8 \times 200 = 96{,}000$ 瓦时,即 $96$ kWh。除以 1000 就把瓦时换算成千瓦时。

Name two ways to reduce the environmental footprint of computing.说出减少计算环境足迹的两种办法。

For example, keep devices longer and repair them to reduce e-waste, recycle electronics responsibly, power data centres with renewable energy, and design software and hardware to use less energy. Any two with a reason each.

例如:更长时间使用并维修设备以减少电子废物,负责任地回收电子产品,用可再生能源为数据中心供电,以及把软件和硬件设计得更节能。任选两种并各给理由即可。

Going deeper: green computing and data centre energy深入:绿色计算与数据中心能耗

BC CS10 Content (verbatim) includes: "power consumption, renewable energy, server farms" under environmental sustainability. Data centres that power the internet and cloud computing are a significant and growing energy consumer. In 2020, global data centres consumed an estimated 200–250 TWh of electricity (roughly 1% of global electricity demand). Cryptocurrency mining, at peak in 2021–2022, consumed electricity comparable to small countries (Bitcoin mining alone was estimated at ~130 TWh/year). Green computing responses include: (1) energy-efficient chip design; (2) data centres powered by renewable energy (e.g., Google claims 100% renewable matching; some use waste heat for district heating); (3) cooling innovations (e.g., Microsoft's Project Natick submerged data centre); (4) on-demand cloud computing that eliminates idle servers; (5) extending device lifespans to reduce e-waste. Ontario ICS3U D1 treats this as a stated expectation, not just enrichment. BC CS10 Big Idea 2 (verbatim): "Social, ethical, and sustainability issues are influenced by design"; the environmental cost of computing is built into the design choices engineers make.BC CS10 内容(原文)在环境可持续性下包含:"能耗、可再生能源、服务器农场"。驱动互联网和云计算的数据中心是一个重大且不断增长的能源消耗者。2020 年,全球数据中心估计消耗 200–250 太瓦时(TWh)电力(约占全球电力需求的 1%)。加密货币挖矿在 2021–2022 年峰值时消耗的电力相当于小型国家(仅比特币挖矿估计约 130 TWh/年)。绿色计算应对措施包括:(1) 节能芯片设计;(2) 使用可再生能源的数据中心(如谷歌声称 100% 可再生能源匹配;一些使用废热供暖);(3) 冷却创新(如微软的 Project Natick 水下数据中心);(4) 消除闲置服务器的按需云计算;(5) 延长设备寿命以减少电子废物。安大略 ICS3U D1 将其列为明确的课程期望,而非仅仅是拓展内容。BC CS10 大概念 2(原文):"社会、伦理和可持续性问题受设计影响",计算的环境成本内置于工程师做出的设计选择中。


Exam Strategy and Common Pitfalls考试策略与常见陷阱

For AP CSP Big Idea 5 questionsAP CSP 大概念 5 题型
  • Skill 5.C: use the impact structure.技能 5.C:使用影响结构。 When asked to "describe the impact of a computing innovation," use this template: Innovation + Beneficial effect + who benefits + Harmful effect + who is harmed. An answer with only one side is incomplete; cover both sides.当被要求"描述计算创新的影响"时,使用此模板:创新 + 有益影响 + 谁受益 + 有害影响 + 谁受害。只写一面的答案是不完整的;两面都要写。
  • Skill 5.E: cite the specific legal or ethical framework.技能 5.E:引用具体的法律或伦理框架。 Name the concept: "informed consent," "data minimisation," "copyright," "GPL." A vague statement like "it is wrong" says little; "it violates informed consent because the user did not agree to secondary data use" names the principle.命名概念:"知情同意"、"数据最小化"、"版权"、"GPL"。像"这是错误的"这样的模糊陈述说明不了什么,而"它违反了知情同意,因为用户没有同意二次数据使用"则指明了原则。
  • Topic 5.3 bias: name the source of bias, not just the effect.主题 5.3 偏见:命名偏见的来源,而非仅描述效果。 Good answer: "The system has higher error rates for dark-skinned faces because training data was not representative." Poor answer: "The system is biased." The source (training data, feature selection, team composition) is what makes the answer precise.好答案:"该系统对深色皮肤面孔错误率更高,因为训练数据不具代表性。"差答案:"该系统存在偏见。"来源(训练数据、特征选择、团队构成)是使答案精确的关键。
Security and privacy questions (§1-§4)安全和隐私问题(§1-§4)
  • Name the threat type precisely.精确命名威胁类型。 Distinguish malware (software), phishing (deception via email/web), and social engineering (human manipulation). "The attacker sent a fake email" = phishing. "The attacker called and pretended to be IT support" = social engineering.区分恶意软件(软件)、钓鱼(通过电子邮件/网页欺骗)和社会工程学(人类操纵)。"攻击者发送了一封假电子邮件"= 钓鱼。"攻击者打电话假装是 IT 支持"= 社会工程学。
  • Symmetric vs asymmetric: always state the key difference.对称 vs 非对称:始终陈述关键区别。 Symmetric = same key for encrypt and decrypt. Asymmetric = public key encrypts, private key decrypts. HTTPS uses both (asymmetric to exchange a symmetric session key). These are often confused.对称 = 加密和解密使用相同密钥。非对称 = 公钥加密,私钥解密。HTTPS 同时使用两者(非对称方式交换对称会话密钥)。这些经常被混淆。
IP and society questions (§5-§7)知识产权和社会问题(§5-§7)
  • Open-source is not the same as free-of-charge.开源不等于免费。 Open-source means the source code is available. A common trap is equating "open source" with "free." Proprietary software can be free-of-charge (freeware) while still restricting modification.开源意味着源代码可用。一个常见的陷阱是将"开源"与"免费"等同。专有软件可以免费(免费软件),同时仍然限制修改。
  • For Ontario ICS4U D2 questions: cite ACM/IEEE.对于安大略 ICS4U D2 问题:引用 ACM/IEEE。 When asked about professional ethics codes, name the ACM Code of Ethics (2018) and IEEE Code of Ethics. State a specific principle (e.g., "ACM principle 1.6: Respect privacy"). Vague answers are weaker than answers that cite a principle.当被问及职业伦理准则时,命名 ACM 伦理准则(2018)和 IEEE 伦理准则。陈述具体原则(如"ACM 原则 1.6:尊重隐私")。模糊的答案不如引用具体原则的答案有力。
Answer hygiene for this unit本单元作答规范
  • Concrete examples always outperform definitions alone.具体例子总是优于单纯的定义。 For every concept, have a real-world example ready: ransomware = WannaCry; digital divide = rural students without broadband; e-waste = old phones whose components can contain lead or cadmium. Examples make arguments credible to the reader.对于每个概念,准备一个真实世界的例子:勒索软件 = WannaCry;数字鸿沟 = 没有宽带的农村学生;电子废物 = 部件中可能含有铅或镉的旧手机。例子使论点更有说服力。
  • Avoid "it is bad for privacy." Use the correct term.避免"这对隐私不好"。使用正确的术语。 Say "it violates data minimisation principles" or "it constitutes secondary use without informed consent." Precise vocabulary is what separates a vague answer from a precise one.说"它违反了数据最小化原则"或"它构成未经知情同意的二次使用"。精确的词汇是区分含糊答案与精确答案的关键。

Flashcards闪卡

0 / 14 flipped0 / 14 已翻
Ransomware勒索软件
Malware that encrypts victim files and demands payment for the decryption key. Defence: offline backups.加密受害者文件并要求支付解密密钥赎金的恶意软件。防御:离线备份。
Phishing钓鱼
Fraudulent attempt to steal credentials by impersonating a trusted entity via email or fake website. ON ICS4U D2.1 example.通过电子邮件或虚假网站冒充可信实体来窃取凭据的欺诈行为。安大略 ICS4U D2.1 示例。
Social engineering社会工程学
Manipulating people (not software) into revealing information or taking unsafe actions. Exploits trust, authority, urgency.操纵人(而非软件)泄露信息或采取不安全行动。利用信任、权威、紧迫感。
Symmetric vs asymmetric encryption对称 vs 非对称加密
Symmetric = one shared key (encrypt + decrypt). Asymmetric = key pair: public key encrypts, private key decrypts. HTTPS uses both.对称 = 一个共享密钥(加密+解密)。非对称 = 密钥对:公钥加密,私钥解密。HTTPS 同时使用两者。
MFA (Multi-factor authentication)MFA(多因素认证)
Authentication using at least two independent factors: something you know + something you have + something you are.使用至少两个独立因素的身份验证:你知道的 + 你拥有的 + 你本身的特征。
PII个人可识别信息(PII)
Personally Identifiable Information: any data that can identify a specific individual (name, email, biometrics). Primary target of data breaches. CSTA 3A-IC-29.可以识别特定个人的任何数据(姓名、电子邮件、生物特征)。数据泄露的主要目标。CSTA 3A-IC-29。
Informed consent知情同意
User genuinely understanding and agreeing to how their data will be collected, used, and shared. Clicking "I agree" without reading is not meaningful consent.用户真正了解并同意如何收集、使用和共享其数据。未阅读就点击"我同意"不是有意义的同意。
Copyright vs open source版权 vs 开源
Copyright = automatic protection; owner controls copying. Open source = source code available under a licence (MIT = permissive; GPL = copyleft).版权 = 自动保护;所有者控制复制。开源 = 源代码在许可下可用(MIT = 宽松;GPL = 著佐权)。
Software piracy软件盗版
Using proprietary software without a valid licence. Violates copyright law. ON ICS4U D2.1 names this as an ethical issue.在没有有效许可的情况下使用专有软件。违反版权法。安大略 ICS4U D2.1 将其列为伦理问题。
Digital divide数字鸿沟
The gap between those with access to computing resources/internet and those without. AP CSP Topic 5.2. BC CS10 names it verbatim.有计算资源/互联网访问权限与没有访问权限的人之间的差距。AP CSP 主题 5.2。BC CS10 原文命名。
Algorithmic bias算法偏见
Systematically unfair outcomes for some groups, caused by biased training data, biased feature selection, or lack of diverse development teams. AP CSP Topic 5.3.由有偏见的训练数据、有偏见的特征选择或缺乏多元化开发团队导致的对某些群体系统性不公平结果。AP CSP 主题 5.3。
Accessibility in computing计算中的可访问性
Designing systems usable by people with diverse abilities. Examples: screen readers, captions, keyboard navigation, high-contrast themes. CSTA 3A-AP-21.设计可供各种能力人士使用的系统。例子:屏幕阅读器、字幕、键盘导航、高对比度主题。CSTA 3A-AP-21。
E-waste and green computing电子废物与绿色计算
E-waste = discarded electronics with toxic materials. Green computing = energy-efficient design, renewable energy, extending device lifespan. ON ICS3U D1.1.电子废物 = 含有毒材料的废弃电子产品。绿色计算 = 节能设计、可再生能源、延长设备寿命。安大略 ICS3U D1.1。
AP CSP Big Idea 5 (IOC) topicsAP CSP 大概念 5(IOC)主题
5.1 Beneficial and Harmful Effects; 5.2 Digital Divide; 5.3 Computing Bias; 5.4 Crowdsourcing; 5.5 Legal and Ethical Concerns; 5.6 Safe Computing.5.1 有益和有害影响;5.2 数字鸿沟;5.3 计算偏见;5.4 众包;5.5 法律和伦理问题;5.6 安全计算。

Practice Quiz综合测验

A user receives an email that appears to be from their bank, asking them to click a link and enter their password. The link leads to a site with a slightly different URL. What is this attack?用户收到一封看起来来自其银行的电子邮件,要求点击链接并输入密码。该链接指向 URL 略有不同的网站。这是什么攻击?
Q1
Ransomware勒索软件
Social engineering (baiting)社会工程学(诱骗)
Phishing钓鱼
Spyware间谍软件
Phishing impersonates a trusted entity (the bank) via email to steal credentials. The fake URL is the tell-tale sign. Defence: inspect URLs carefully; go directly to the bank's site.钓鱼通过电子邮件冒充可信实体(银行)来窃取凭据。虚假 URL 是识别信号。防御:仔细检查 URL;直接访问银行网站。
Ransomware encrypts files. Baiting leaves physical lures (like USB drives). Spyware records activity silently. Email impersonation = phishing.勒索软件加密文件。诱骗留下物理诱饵(如 USB 驱动器)。间谍软件悄悄记录活动。电子邮件冒充 = 钓鱼。
Which encryption method uses a public key for encryption and a private key for decryption?哪种加密方法使用公钥加密和私钥解密?
Q2
Symmetric encryption对称加密
Asymmetric encryption非对称加密
Hashing哈希
MFAMFA
Asymmetric encryption uses a mathematically linked key pair: public key (shareable) encrypts; private key (secret) decrypts. Used in HTTPS, SSH, email signing. Symmetric uses one shared key for both operations.非对称加密使用数学上关联的密钥对:公钥(可共享)加密;私钥(秘密)解密。用于 HTTPS、SSH、电子邮件签名。对称加密使用一个共享密钥进行两种操作。
Symmetric = one key for both. Asymmetric = key pair (public encrypts, private decrypts). Hashing = one-way, not reversible. MFA = authentication method, not encryption.对称 = 两者使用一个密钥。非对称 = 密钥对(公钥加密,私钥解密)。哈希 = 单向,不可逆。MFA = 身份验证方法,不是加密。
A company's HR system was trained on historical hiring data from a male-dominated industry and now systematically gives women lower scores. What is the root cause?一家公司的人力资源系统在以男性为主的行业的历史招聘数据上进行训练,现在系统性地给女性更低的分数。根本原因是什么?
Q3
A phishing attack on the HR database对人力资源数据库的钓鱼攻击
Lack of encryption on the training data训练数据缺乏加密
Software piracy of the machine learning library机器学习库的软件盗版
Algorithmic bias from biased training data encoding historical discrimination训练数据中编码的历史歧视导致的算法偏见
Algorithmic bias from biased training data. The historical hiring data reflected a biased process; the model learned to reproduce that bias. CSTA 3A-IC-25 and AP CSP Topic 5.3 address this. Fix: more representative training data and diverse evaluation panels.来自有偏见训练数据的算法偏见。历史招聘数据反映了一个有偏见的过程;模型学会了重现这种偏见。CSTA 3A-IC-25 和 AP CSP 主题 5.3 涉及这一问题。解决方案:更具代表性的训练数据和多元化的评估小组。
This is algorithmic bias from training data, not a security attack, encryption failure, or licensing issue. The system discriminates because it learned from discriminatory historical data.这是来自训练数据的算法偏见,而非安全攻击、加密失败或许可问题。系统歧视是因为它从有歧视性的历史数据中学习。
Under the GPL (GNU General Public Licence), if you modify an open-source program and distribute it, what must you do?在 GPL(GNU 通用公共许可)下,如果你修改一个开源程序并分发它,你必须做什么?
Q4
Release your modifications under the same GPL licence在相同的 GPL 许可下发布你的修改
Pay a licensing fee to the original author向原作者支付许可费
Keep your modifications proprietary保持你的修改专有
Register the software with the copyright office向版权局注册软件
GPL is a copyleft licence: any derivative work distributed publicly must also be released under the GPL. This "viral" property ensures open-source software stays open. MIT and Apache 2.0 licences do not require this; they are permissive.GPL 是著佐权许可:任何公开分发的衍生作品也必须在 GPL 下发布。这种"传染性"属性确保开源软件保持开放。MIT 和 Apache 2.0 许可不要求这样做,它们是宽松的。
GPL has no fee. It requires copyleft: derivatives must stay open-source under GPL. You cannot make GPL-derived code proprietary. Registration is not required for copyright protection.GPL 没有费用。它要求著佐权:衍生作品必须在 GPL 下保持开源。你不能将 GPL 派生代码设为专有。版权保护不需要注册。
Ontario ICS3U strand D1 expectations focus on which of the following?安大略 ICS3U D1 期望关注以下哪一项?
Q5
Algorithmic efficiency analysis算法效率分析
Object-oriented programming concepts面向对象编程概念
Environmental stewardship and sustainability of computer use计算机使用的环境管理和可持续性
Network protocols and TCP/IP网络协议和 TCP/IP
Ontario ICS3U D1 (verbatim): "describe policies on computer use that promote environmental stewardship and sustainability." D1.1 names e-waste, health effects. This green-computing theme recurs across the Ontario ICS courses.安大略 ICS3U D1(原文):"描述促进环境管理和可持续性的计算机使用政策。" D1.1 命名了电子废物、健康影响。这一绿色计算主题在安大略 ICS 课程中反复出现。
D1 is specifically about environmental sustainability, not algorithm efficiency, OOP or network protocols.D1 专门关注环境可持续性,而不是算法效率、OOP 或网络协议。
CSTA 3A-IC-28 says: "Explain the beneficial and harmful effects that intellectual property laws can have on innovation." Which example best illustrates a HARMFUL effect of IP law on innovation?CSTA 3A-IC-28 说:"解释知识产权法律对创新可能产生的有益和有害影响。"哪个例子最能说明知识产权法律对创新的有害影响?
Q6
A company patents a new algorithm, enabling them to profit from their invention一家公司为新算法申请专利,使他们能够从发明中获利
A broad software patent blocks competitors from using a widely-needed technique for 20 years一项广泛的软件专利阻止竞争对手在 20 年内使用一种广泛需要的技术
Open-source licences use copyright law to keep software open开源许可利用版权法保持软件开放
Copyright protects a programmer's original code from being copied版权保护程序员的原创代码不被复制
Broad or overly aggressive patents can stifle innovation by blocking competitors from implementing fundamental techniques for decades. This is the "harmful effect" that CSTA 3A-IC-28 asks you to evaluate. Options A, C, and D are beneficial effects of IP law.广泛或过于激进的专利可以通过阻止竞争对手实施数十年的基本技术来抑制创新。这是 CSTA 3A-IC-28 要求你评估的"有害影响"。选项 A、C 和 D 是知识产权法律的有益影响。
The question asks for a HARMFUL effect. Profit from patents (A), copyleft (C), and code protection (D) are beneficial effects. Broad patents blocking innovation is the harmful effect.题目询问的是有害影响。从专利获利(A)、著佐权(C)和代码保护(D)是有益影响。阻碍创新的广泛专利是有害影响。
AP CSP Skill 5.C asks you to "describe the impact of a computing innovation." Which answer best demonstrates this skill for GPS navigation apps?AP CSP 技能 5.C 要求你"描述计算创新的影响"。哪个答案最能展示对 GPS 导航应用的这一技能?
Q7
GPS apps use satellite signals to determine locationGPS 应用使用卫星信号确定位置
GPS apps are very popular and used by millions of peopleGPS 应用非常流行,被数百万人使用
GPS apps help people find directions when they are lostGPS 应用帮助人们在迷路时找到方向
GPS apps benefit commuters with real-time routing but collect location data that can be used for surveillance without users' awarenessGPS 应用为通勤者提供实时路线规划带来好处,但在用户不知情的情况下收集可用于监控的位置数据
Skill 5.C requires identifying both beneficial effects (real-time routing helps commuters) AND harmful effects (location surveillance) AND affected groups. Option D does all three. The other options describe how GPS works or its popularity, not its impact.技能 5.C 要求识别有益影响(实时路线规划帮助通勤者)和有害影响(位置监控)以及受影响的群体。选项 D 完成了所有三个方面。其他选项描述 GPS 的工作方式或受欢迎程度,而非其影响。
Skill 5.C requires IMPACT; both beneficial and harmful effects on people. "GPS uses satellites" (A) = how it works. "Very popular" (B) = usage stats. "Helps when lost" (C) = one benefit only. Only D covers both sides of impact.技能 5.C 要求影响,对人的有益和有害影响。"GPS 使用卫星"(A)= 工作方式。"非常流行"(B)= 使用统计。"迷路时帮助"(C)= 仅一个好处。只有 D 涵盖了影响的两面。

Readiness Checklist准备就绪清单

Tick each item when you can do it cold, without notes, on a first attempt.能在无笔记、首次尝试下完成,再勾选每一项。

0 / 11 mastered已掌握 0 / 11

What This Feeds Into本单元的去向

Cybersecurity, ethics and society is where the technical units of this course meet the real-world consequences of computing. The threats you studied here, malware, phishing, and unauthorised access, all travel over the networks of Unit 11, target the data and databases of Unit 10, and rely on the binary and Boolean foundations of Unit 9 to make encryption and authentication work. The cross-references below point back to the HS Computer Science units that supply the mechanisms this unit secures, so you can see exactly where an attack enters and what is being protected.网络安全、伦理与社会是本课程的技术单元与计算的现实后果相交汇之处。你在此学习的威胁,即恶意软件、网络钓鱼与未授权访问,都通过第 11 单元的网络传播,针对第 10 单元的数据与数据库,并依赖第 9 单元的二进制与布尔基础使加密与身份验证得以运作。下方的交叉链接指回为本单元所保护的机制提供支撑的 HS Computer Science 单元,让你清楚看到攻击从何处进入、被保护的又是什么。

Within High School Computer Science.在 HS Computer Science 内部。

Networks and the Internet is the channel almost every attack uses: packets, ports, and the client-server model explain how phishing pages are served and how a firewall filters hostile traffic. Data, Databases and the Web is what attackers are usually after, so the access-control, hashing, and privacy practices here exist to protect stored records and the queries that touch them. Boolean Logic and Number Systems is the layer underneath encryption and authentication, because XOR, bitwise operations, and binary representation are exactly what ciphers and hash functions manipulate. Read together, these three units tell you the path of an attack, the target of an attack, and the math that defends against it.网络与互联网几乎是每一次攻击所使用的通道:数据包、端口与客户端-服务器模型解释了网络钓鱼页面如何被传送,以及防火墙如何过滤恶意流量。数据、数据库与 Web 通常正是攻击者的目标,因此此处的访问控制、哈希与隐私实践,存在的意义就是保护所存储的记录以及触及它们的查询。布尔逻辑与数字系统是加密与身份验证之下的一层,因为异或、按位运算与二进制表示正是密码与哈希函数所操作的对象。三者合读,便能告诉你攻击的路径、攻击的目标,以及防御它的数学原理。

Across the HS Computer Science feeders in this repo.本仓库中的 HS Computer Science 衔接单元。

HS Computer Science Unit 11 · Networks and the Internet (the channel attacks travel over: packets, ports, client-server, and how firewalls filter hostile traffic)HS Computer Science Unit 11 · 网络与互联网(攻击传播的通道:数据包、端口、客户端-服务器,以及防火墙如何过滤恶意流量) HS Computer Science Unit 10 · Data, Databases and the Web (what attackers target: the stored records and queries that access control, hashing, and privacy rules protect)HS Computer Science Unit 10 · 数据、数据库与 Web(攻击者的目标:访问控制、哈希与隐私规则所保护的存储记录与查询) HS Computer Science Unit 9 · Boolean Logic and Number Systems (the layer under encryption: XOR, bitwise operations, and binary that ciphers and hash functions manipulate)HS Computer Science Unit 9 · 布尔逻辑与数字系统(加密之下的一层:密码与哈希函数所操作的异或、按位运算与二进制)

This unit sits at the top of the HS Computer Science sequence and pulls the technical strands together, so there is no required downstream HS unit. The natural next step is AP Computer Science Principles Big Idea 5 (Impact of Computing) and the security objectives in Big Idea 4, which cover the ethics, privacy, and cybersecurity reasoning practised here. Students continuing into university find this material reappears in introductory information-security and computing-ethics courses, where encryption, authentication, and responsible-disclosure debates are treated in more formal depth.本单元位于 HS Computer Science 序列的顶端,将各条技术线索汇聚在一起,因此没有必修的下游 HS 单元。自然的下一步是 AP Computer Science Principles 大概念 5(计算的影响)以及大概念 4 中的安全目标,它们涵盖的正是此处所练习的伦理、隐私与网络安全推理。继续升入大学的学生会发现这些内容重现于信息安全与计算伦理入门课程中,加密、身份验证与负责任披露的讨论会以更正式、更深入的方式呈现。

This is the ladder we coach students up: from these high school foundations into AP and IB, and on to first-year university. If you would rather have a guide for the next step than take it on trust, Dingrui Scholars tutors teach exactly this path in one-on-one sessions and small-group classes. A free assessment is the place to start.这正是我们陪伴学生攀登的阶梯:从这些高中基础,迈入 AP 与 IB,再走向大学一年级。如果你希望在下一步有人引路,而不是凭感觉前行,Dingrui Scholars 的导师正是沿着这条路径,以一对一辅导与小班课授课。欢迎从免费评估开始。

Common Questions常见问题

What is phishing and how do I protect against it?什么是网络钓鱼,如何防范?

Phishing is a fraudulent attempt to obtain sensitive information like passwords or credit card numbers by impersonating a trusted entity through email, SMS, or a fake website. To protect yourself, hover over links to preview the real URL, verify sender addresses, and be sceptical of unexpected attachments.网络钓鱼是通过电子邮件、短信或假网站冒充可信实体,企图骗取密码或信用卡号等敏感信息的欺诈行为。要防范,可将鼠标悬停在链接上预览真实网址、核实发件人地址,并对意外的附件保持警惕。

What are the different types of malware?恶意软件有哪些不同类型?

Malware is malicious software designed to disrupt, damage, or gain unauthorised access, and its main types include viruses that attach to files, worms that self-replicate across a network, Trojans disguised as legitimate software, ransomware that encrypts your files for payment, and spyware that secretly monitors you.恶意软件是旨在破坏、损害或非法获取访问权限的软件,主要类型包括附着在文件上的病毒、在网络上自我复制的蠕虫、伪装成合法软件的特洛伊木马、加密文件勒索付款的勒索软件,以及秘密监视你的间谍软件。

What is the difference between copyright and fair use?版权和合理使用有什么区别?

Copyright is automatic legal protection for original creative works from the moment of creation, giving the creator control over copying and distribution, and software is protected by copyright by default. Fair use is a limited exception in the US allowing use of copyrighted material for purposes like education, criticism, and parody; Canada and the UK have a related but separate doctrine called fair dealing.版权是对原创作品从创作之时起的自动法律保护,赋予创作者对复制和分发的控制权,软件默认受版权保护。合理使用是美国的一项有限例外,允许出于教育、评论和讽刺等目的使用受版权保护的材料;加拿大和英国有相关但不同的制度,称为公平处理(fair dealing)。

Syllabus alignment & how to use this guide大纲对照与使用说明

How to use this guide如何使用本指南

Cybersecurity, ethics, and society topics appear in all four curricula but with very different emphases. AP CSP Big Idea 5 (IOC) is the most structured, with named topics (5.1 through 5.6) and named skills. BC Computer Studies 10 is the broadest on social impact, covering digital citizenship, e-waste, conflict minerals, and cultural appropriation. Ontario's ICS3U/ICS4U strand D has a distinctive green-computing emphasis and requires students to engage with professional codes of ethics (ACM/IEEE). Alberta CSE is the weakest on explicit ethics; there is no dedicated cybersecurity or ethics module; the generic basic-competency outcomes are the only hook. The table below shows which sections are most important for your curriculum.网络安全、伦理和社会主题出现在全部四套课程中,但侧重点差异显著。AP CSP 大概念 5(IOC)最为系统,有命名主题(5.1 至 5.6)和具体技能。BC Computer Studies 10 在社会影响方面最为广泛,涵盖数字公民身份、电子废物、冲突矿产和文化挪用。安大略 ICS3U/ICS4U D 单元具有独特的绿色计算重点,要求学生了解专业伦理准则(ACM/IEEE)。阿尔伯塔 CSE 在明确伦理方面最为薄弱,没有专门的网络安全或伦理模块;通用基本能力结果是唯一的联系点。下表显示哪些节对你的课程最重要。

If you are in…如果你在… Focus on these sections重点学习 Defer / lighter可推迟 / 减负 Source依据
🇺🇸 AP CSPAP CSP §1–§7 in full. AP CSP Big Idea 5 (IOC) maps directly: §1 security/threats = Topic 5.6; §4 privacy/data = Topics 5.5, 5.6; §5 IP/licensing = Topic 5.5; §6 societal impact = Topic 5.1; §7 bias/accessibility = Topics 5.2, 5.3. Topic 5.4 (crowdsourcing) is not developed in this unit.§1 至 §7 完整学习。AP CSP 大概念 5(IOC)直接对应:§1 安全/威胁 = 主题 5.6;§4 隐私/数据 = 主题 5.5、5.6;§5 知识产权/许可 = 主题 5.5;§6 社会影响 = 主题 5.1;§7 偏见/可访问性 = 主题 5.2、5.3。主题 5.4(众包)本单元未展开。 Nothing: Big Idea 5 is the core of this unit.无:大概念 5 是本单元的核心。 CSTA K-12 and AP CSP: CSTA 3A-IC-24/25/28/29/30; AP CSP IOC Topics 5.1–5.6:CSTA 3A-IC-24/25/28/29/30;AP CSP IOC 主题 5.1–5.6
🇨🇦 ON: ICS3U/ICS4U安大略:ICS3U/ICS4U §1 (threats/safe computing); §4 (privacy); §5 (IP); §6 (societal impact); §7 (sustainability/e-waste). ICS3U D1 maps to §7 green-computing; ICS4U D2 maps to §4 privacy and §5 IP.§1(威胁/安全计算);§4(隐私);§5(知识产权);§6(社会影响);§7(可持续性/电子废物)。ICS3U D1 对应 §7 绿色计算;ICS4U D2 对应 §4 隐私和 §5 知识产权。 §2 (encryption detail) and §3 (safe computing technical) are lighter for ON students; ON strand D focuses on ethics, not technical security mechanisms.§2(加密细节)和 §3(安全计算技术层面)对安大略学生较轻,安大略 D 单元侧重伦理而非技术安全机制。 ON/BC Computer Studies 11-12: ICS3U D1, D1.1; ICS4U D2, D2.1, D2.2, D2.3, D3:ICS3U D1、D1.1;ICS4U D2、D2.1、D2.2、D2.3、D3
🇨🇦 BC: CS10BC:CS10 §1 through §7. BC Computer Studies 10 content is the broadest of the four curricula on this topic; it explicitly names malware, ransomware, phishing, copyright, cyberbullying, e-waste, conflict minerals, and digital citizenship. All sections map.§1 至 §7。BC Computer Studies 10 内容在此主题上是四套课程中最广泛的,明确命名了恶意软件、勒索软件、钓鱼、版权、网络欺凌、电子废物、冲突矿产和数字公民身份。所有节均对应。 Nothing: CS10 covers this topic more extensively than any other curriculum at the foundations level.无:CS10 在基础层面对此主题的覆盖比其他任何课程都更广泛。 ON/BC Computer Studies 11-12: BC CS10 "computer security risks," "ethical considerations," "digital literacy" Content bullets:BC CS10"计算机安全风险"、"伦理考量"、"数字素养"内容条目
🇨🇦 AB: CSE阿尔伯塔:CSE §3 (safe computing) and §6 (societal impact) as general-competency anchors. The cross-module outcome 4 ("demonstrate basic competencies … think and solve problems") is the only explicit hook. Treat the full guide as enrichment for AB students.§3(安全计算)和 §6(社会影响)作为通用能力锚点。跨模块结果 4("展示基本能力……思考和解决问题")是唯一的明确联系点。对阿尔伯塔学生将完整指南视为拓展内容。 All sections are enrichment for AB: CSE has no dedicated ethics/cybersecurity module. The content is still valuable; it is simply not tied to a specific CSE outcome.所有节对阿尔伯塔均为拓展,CSE 没有专门的伦理/网络安全模块。内容仍有价值;只是没有与 CSE 的具体结果挂钩。 Alberta CTS Computing Science: cross-module basic-competency outcome 4; syllabus note: weakest on explicit ethics:跨模块基本能力结果 4;课纲说明:显性伦理最薄弱

Once you have located your row, use the two cards below for approach and focus.找到所在行后,用下面两张卡片决定学习方向和重点。

!
If you are cramming the night before如果你在临阵磨枪

Memorise: the three threat categories (malware, phishing, social engineering); symmetric vs asymmetric encryption in one sentence each; what MFA is and why it helps; the difference between copyright and open-source licensing; and three societal impacts of computing (digital divide, automation effects, environmental cost). Read every cram-cheat box. Skip the going-deeper subsections.背熟:三类威胁(恶意软件、钓鱼、社会工程学);用一句话分别描述对称与非对称加密;什么是多因素认证(MFA)及其原因;版权与开源许可的区别;以及计算的三个社会影响(数字鸿沟、自动化影响、环境成本)。读每个速记框,跳过深入小节。

*
If you are going for the top mark如果你目标顶分

For AP CSP Big Idea 5, the matching skills are 5.C ("Describe the impact of a computing innovation") and 5.E ("Evaluate the use of computing based on legal and ethical factors"); practise them with concrete examples from each section. For ON ICS4U D2, be ready to investigate a specific ethical case (phishing, piracy, keystroke logging) and cite ACM/IEEE codes. For BC, know the full spectrum: threats, ethics, sustainability, digital citizenship.对于 AP CSP 大概念 5,对应的技能是 5.C("描述计算创新的影响")和 5.E("根据法律和伦理因素评估计算的使用");请用每节的具体例子练习它们。对于安大略 ICS4U D2,准备好调查具体的伦理案例(钓鱼、盗版、键盘记录)并引用 ACM/IEEE 准则。对于 BC,了解完整范围:威胁、伦理、可持续性、数字公民身份。

Alberta syllabus note.阿尔伯塔课纲说明。 Alberta CSE has no dedicated cybersecurity or computing-ethics module in the CSE cluster. Ethics and digital-citizenship content lives in the CTS Enterprise & Innovation (ENS) framework and the generic cross-module competency outcomes. Students taking Alberta CSE courses should treat this guide as valuable enrichment and career-awareness content, not as material tied to a specific module outcome code.阿尔伯塔 CSE 模块中没有专门的网络安全或计算伦理模块。伦理和数字公民内容位于 CTS 企业与创新(ENS)框架和通用跨模块能力结果中。学习阿尔伯塔 CSE 课程的学生应将本指南视为有价值的拓展内容和职业意识培养材料,而非与特定模块结果代码挂钩的内容。