跳到正文

第 20 课 · Security and Privacy

Privacy by Design and Individual Rights

Apply privacy principles such as purpose limitation and minimization, keep a processing record, run impact assessments and handle individual rights requests.

Security protects data from the wrong people. Privacy is about whether you should collect and use data at all, and how to respect the people it describes. A perfectly secured system can still violate privacy, for example by using health data for advertising without a proper basis.

Privacy laws differ between countries and sectors. The EU GDPR is widely discussed, and many other places have their own laws. This lesson teaches common ideas, using GDPR as an example. It is not legal advice.

Personal data

Personal data is broadly information about an identified or identifiable person. It can include obvious identifiers, and also online identifiers, location data or combinations that single someone out. Some categories, such as health or biometric data used to identify people, receive stronger protection in many laws.

Principles that travel well

The GDPR sets out principles in Article 5. In plain words:

Principle Practical question
Lawfulness, fairness, transparency Do we have a valid basis, and do people know?
Purpose limitation Is each use compatible with why we collected it?
Data minimization Do we need every field?
Accuracy Is it correct and kept up to date?
Storage limitation How long do we keep it identifiable?
Integrity and confidentiality Is it protected?
Accountability Can we show we comply?

Read the official text for the exact wording. Consent is only one possible legal basis; which basis applies depends on the situation, so ask your privacy advisers.

Privacy by design

Build privacy in from the start:

  1. State the purpose before collecting.
  2. Collect only what the purpose needs.
  3. Choose privacy-protective defaults.
  4. Plan deletion at design time.
  5. Limit access and separate identifiers from other data.
  6. Explain use in plain language.
  7. Assess risk before launching risky processing.
Python Stand-in: data minimization check for a signup form

Press Run (or Ctrl + Enter) to see the result here.

Program input · what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

If someone wants phone back, they must name a purpose and have a valid basis for it.

Records and impact assessments

Many laws expect organizations to know what they process. GDPR Article 30 requires records of processing activities, with some exceptions. The article lists the required contents, which include items such as contact details, so check it. A simplified, illustrative record row looks like this:

TEXT
Activity   : Customer order fulfilment
Purpose    : Deliver purchases
Categories : customers; name, address, email, order history
Recipients : delivery partners, payment provider
Transfers  : countries involved and safeguards
Retention  : see schedule "orders"
Security   : encryption, role-based access, logging
Owner      : Operations data owner

For processing likely to create high risk to people, the GDPR calls for a data protection impact assessment before it starts. Describe the processing, why it is necessary and proportionate, the risks to people, and the measures that reduce them. Involve privacy specialists early.

Individual rights

Depending on the law, people may have rights such as to be informed, to access their data, to correct it, to delete it, to restrict or object to certain processing, and to receive a portable copy. Rights are often subject to conditions and exceptions.

Under the GDPR, a controller must respond to a request without undue delay and within one month of receiving it. That period can be extended by up to two further months where necessary because of complexity or the number of requests, and the person must be told about the extension and reasons within the first month. Check current guidance for your case.

A good request process: log the request, verify identity proportionately, find all relevant data (lineage and inventory help here), review exceptions, respond securely and record what you did.

SQL Track request deadlines (SQL)

Press Run (or Ctrl + Enter) to see the result here.

Sharing and processors

When another company processes data for you, you usually need a written agreement that sets limits and duties. Check what they may do with the data, where it is stored, which subprocessors they use and how deletion works. Transfers across borders can have extra requirements.

Privacy and AI

Using personal data to train, test or prompt AI systems is processing too. Revisit purpose, legal basis, minimization, retention and people's rights before doing it.

"We anonymized it" is not a magic phrase. If someone can reasonably re-identify people, the data may still be personal data and the rules still apply.

A worked example: a new feature

A fictional fitness app plans to show members who else is at the gym. Before building it, the team asks: What is the purpose? Who sees what? Could someone be followed or harassed? The first design shows every member's name and arrival time by default.

A privacy-friendly redesign keeps the feature off until a member turns it on, shows only people who chose to share with each other, hides exact times, deletes presence data after a short period and makes turning it off easy. Because location patterns can create real risk to people, the team asks its privacy specialist whether a formal impact assessment is required before launch.

The important point is timing. These choices cost little on a whiteboard and much more after many people have been exposed.

Transparency in plain words

Privacy notices should tell people what is collected, why, on what basis, who receives it, how long it is kept, what rights they have and how to contact the organization. Layer the information: a short summary where data is collected, with a link to details. Keep the notice consistent with what systems actually do. Your processing record and retention schedule are good sources for checking that.

Check your understanding

Quick check · 3 questions

of 3 answered You scored / 3 · perfect!

  1. 1. Which principle asks whether every collected field is needed?

    Minimization limits data to what the purpose requires.
  2. 2. Under the GDPR, what is the usual starting deadline to respond to a data subject request?

    It can be extended in some cases, with notice to the person within the first month.
  3. 3. When should privacy design happen?

    Early decisions are cheaper and safer than retrofitting.

Summary

  • Privacy asks whether and why you use data, not only how you secure it.
  • Minimize data, limit purposes and plan retention from the start.
  • Keep processing records and assess high-risk processing before launch.
  • Run a reliable, deadline-aware process for individual rights.
  • Confirm legal specifics with qualified advisers.

Next: Data Retention and Disposal

你的学习进度保存在此浏览器中,无需账号。