00->1
Learning pathStep 15 of 62Threats, risk and controls ← All writeups

Data Security and Privacy Basics, Explained

If you are reading this, you have probably heard that "data is the new oil" or that a breach "leaked millions of records," and you want to know what protecting data really involves, and how security differs from privacy.

By the end you will be able to sort data by how much harm its loss would cause, name the three states data can be in, explain encryption, masking, tokenisation, pseudonymisation and anonymisation without mixing them up, describe safe disposal, and read the key breach and security duties in GDPR and in India's data protection law. This writeup builds on The CIA Triad and Risk and Security Controls.

A note on law: this guide explains what the legal texts say. It is not legal advice, and laws change. Where a date matters, it is stated.


1. Data security and data privacy are not the same

Data security Data privacy
Question Is the data protected from people and events that should not reach it? Is personal data collected, used, shared and kept in a fair, limited and lawful way?
Concerned with Confidentiality, integrity and availability of any data Individuals and how their personal data is handled
Example failure An attacker downloads a database A company legitimately holds your data but uses it for something you were never told about

You can have security without privacy (a very secure database that collects far too much about people) but you cannot have privacy without security, because personal data that leaks has no privacy. The NIST Privacy Framework describes itself as "a voluntary tool developed in collaboration with stakeholders intended to help organizations identify and manage privacy risk to build innovative products and services while protecting individuals' privacy."

What counts as personal data

  • GDPR (EU), Article 4(1): "any information relating to an identified or identifiable natural person ('data subject'); an identifiable natural person is one who can be identified, directly or indirectly, in particular by reference to an identifier such as a name, an identification number, location data, an online identifier or to one or more factors specific to the physical, physiological, genetic, mental, economic, cultural or social identity of that natural person."
  • NIST SP 800-122 (PII): "any information about an individual maintained by an agency, including (1) any information that can be used to distinguish or trace an individual's identity, such as name, social security number, date and place of birth, mother's maiden name, or biometric records; and (2) any other information that is linked or linkable to an individual, such as medical, educational, financial, and employment information."

The practical lesson from both is the same: data does not need a name attached to be personal. If it can be linked to a person, treat it as personal.


2. Classifying data

You cannot protect what you have not identified. NIST SP 800-122 says it directly: "An organization cannot properly protect PII it does not know about." The first job is therefore to find the data (databases, shared drives, backups, laptops, email) and decide how sensitive each kind is.

Impact levels (FIPS 199)

US federal standard FIPS 199 rates the harm from losing confidentiality, integrity or availability as low, moderate or high:

Level FIPS 199 wording
Low "a limited adverse effect on organizational operations, organizational assets, or individuals"
Moderate "a serious adverse effect on organizational operations, organizational assets, or individuals"
High "a severe or catastrophic adverse effect on organizational operations, organizational assets, or individuals"

FIPS 199 writes the result as a set: confidentiality, integrity and availability each get their own level, for example {(confidentiality, moderate), (integrity, high), (availability, low)}. That matches the lesson in The CIA Triad: different data needs different priorities.

Everyday labels

Organisations usually choose simple labels of their own. A common pattern is public, internal, confidential and restricted. These names are a convention, not a standard: what matters is that each label has written handling rules (who may see it, where it may be stored, how it may be shared, how long it is kept). NIST SP 800-53 control MP-3 (media marking) is about putting those rules on the media: "Mark system media indicating the distribution limitations, handling caveats, and applicable security markings."

A quick way to classify: ask "if this appeared on the internet tomorrow, who would be harmed and how badly?"

Example Likely handling
Published blog post Public: integrity matters more than secrecy
Staff phone directory Internal
Customer email addresses and order history Confidential: personal data
Passwords, API keys, medical or financial records Restricted: strongest controls

3. The three states of data

Protection differs depending on what the data is doing.

State Meaning Typical protections
At rest Stored, not moving Disk or database encryption, access controls, backups
In transit Moving across a network TLS, VPNs, secure Wi-Fi
In use Being processed in memory or on screen Strong access control, screen locks, data loss prevention, careful logging

NIST SP 800-53 defines the first two as controls. SC-28 (protection of information at rest) says "information at rest refers to the state of information when it is not in process or in transit and is located on system components," and adds that "the focus of protecting information at rest is not on the type of storage device or frequency of access but rather on the state of the information." SC-8 (transmission confidentiality and integrity) notes that "unprotected communication paths are exposed to the possibility of interception and modification." For how TLS protects data in transit, see Understanding Handshakes.

Data loss prevention (DLP) tools try to cover all three. The CNSSI definition in NIST's glossary describes it as a system's "ability to identify, monitor, and protect data in use (e.g. endpoint actions), data in motion (e.g. network actions), and data at rest (e.g. data storage)."


4. Encryption, in one section

Encryption scrambles data with a key so that only someone with the key can read it. Used on data at rest, it matters most when a device or disk is lost or stolen. Microsoft describes BitLocker as a feature "that provides encryption for entire volumes, addressing the threats of data theft or exposure from lost, stolen, or inappropriately decommissioned devices."

Three ideas to hold on to:

  1. The key is the secret, not the method. This is the open-design principle from Security Design Principles. Protect, back up and rotate keys; a locked safe with the key taped to it protects nothing.
  2. Encryption protects against some threats, not all. If an attacker steals a logged-in user's session, the data is already decrypted for that user. Encryption at rest does little against a bug that lets a web application read the database for the attacker.
  3. Encryption alone does not prove the data is unchanged. Integrity needs hashes, signatures or authenticated encryption, as covered in the CIA writeup.

5. Making data less risky: masking, tokenisation, pseudonymisation, anonymisation

Often the safest data is data that is not there, or data that no longer points to a person. Several techniques sit between "full data" and "no data". They are easy to confuse, so here they are side by side.

Technique What it does Can the original be recovered?
Masking (obfuscation) Hides part of a value, such as showing only the last four digits of a card or r***@example.com Not from the masked copy, but the original still exists elsewhere
Tokenisation Replaces a value with a random stand-in (a token); the real value is kept in a separate protected store Yes, through the token store
Pseudonymisation Replaces identifying fields with a code, keeping the key to re-link them separately Yes, with the separately held additional information
De-identification Removes or obscures enough identifying data that the rest does not identify a person Depends on method and what other data exists
Anonymisation De-identification where no link back to the person remains No

The official wording:

  • GDPR Article 4(5), pseudonymisation: "the processing of personal data in such a manner that the personal data can no longer be attributed to a specific data subject without the use of additional information, provided that such additional information is kept separately and is subject to technical and organisational measures to ensure that the personal data are not attributed to an identified or identifiable natural person."
  • NIST SP 800-122, de-identified information: records "that have had enough PII removed or obscured, also referred to as masked or obfuscated, such that the remaining information does not identify an individual and there is no reasonable basis to believe that the information can be used to identify an individual." It adds that anonymized information is "previously identifiable information that has been de-identified and for which a code or other association for re-identification no longer exists."
  • India's Digital Personal Data Protection Rules, 2025, rule 6(1)(a) lists "securing of personal data through encryption, obfuscation, masking or the use of virtual tokens mapped to that personal data" as an example of appropriate data security measures.

The key warning: pseudonymised data is still personal data

GDPR recital 26 states: "Personal data which have undergone pseudonymisation, which could be attributed to a natural person by the use of additional information should be considered to be information on an identifiable natural person." Replacing names with ID numbers is therefore a safeguard, not an escape from the rules.

Truly anonymous data is different: the same recital says the principles "should therefore not apply to anonymous information". But to decide whether someone is identifiable, "account should be taken of all the means reasonably likely to be used," including "the costs of and the amount of time required for identification" and "the available technology." NIST SP 800-122 makes the same practical point: "the amount of information available publicly and advances in computational technology make full anonymity of released datasets (e.g., census data and public health data) difficult to accomplish."

So if you remove names but keep date of birth, postcode and gender, the dataset may still point to one person once combined with other data. Treat "anonymised" as a claim that needs testing, not a label you can simply write on a file.


6. Collect less: data minimisation

Every record you keep is a record that can leak. The cheapest control is not to collect or keep it.

  • GDPR Article 5(1)(c), data minimisation: personal data shall be "adequate, relevant and limited to what is necessary in relation to the purposes for which they are processed."
  • GDPR Article 5(1)(e), storage limitation: kept "in a form which permits identification of data subjects for no longer than is necessary for the purposes for which the personal data are processed."
  • GDPR Article 25(2), by default: the controller shall implement measures "for ensuring that, by default, only personal data which are necessary for each specific purpose of the processing are processed," which applies to "the amount of personal data collected, the extent of their processing, the period of their storage and their accessibility."
  • NIST SP 800-122: "By limiting PII collections to the least amount necessary to conduct its mission, the organization may limit potential negative consequences in the event of a data breach involving PII."

This is the least privilege and fail-safe defaults ideas from Security Design Principles applied to data itself. A sign-up form that asks for a date of birth it never uses is a liability, not an asset.


7. Disposal: deleting is not the same as destroying

When a disk, phone or printer is retired, the data on it remains unless it is properly removed. Deleting a file normally removes the pointer to it, not the contents. NIST SP 800-53 control MP-6 (media sanitization) requires organisations to sanitise system media "prior to disposal, release out of organizational control, or release for reuse," using mechanisms with strength and integrity "commensurate with the security category or classification of the information." Its discussion lists the techniques: "clearing, purging, cryptographic erase, deidentification of personally identifiable information, and destruction."

NIST's glossary describes sanitisation as removing "information from the storage device such that data recovery using any known technique or analysis is prevented." For a hands-on view of what careless disposal exposes, see Dumpster Diving, which covers the clear, purge and destroy levels.

Cryptographic erase is worth remembering: if all data on a device is encrypted, securely destroying the key makes the data unreadable without needing to wipe every block.


8. Backups and recovery are data security too

Availability is part of the triad. India's rules list "reasonable measures for continued processing in the event of confidentiality, integrity or availability of such personal data being compromised as a result of destruction or loss of access to personal data or otherwise, such as by way of data-backups." GDPR Article 32 asks for "the ability to restore the availability and access to personal data in a timely manner in the event of a physical or technical incident."

A backup is only a backup if you have tested restoring from it, it is stored separately from the system it protects, and it is protected as strongly as the original data, since it contains the same information.


9. What the law asks of you

GDPR (European Union)

Three provisions give the flavour.

Article 5(1)(f): integrity and confidentiality. Personal data shall be "processed in a manner that ensures appropriate security of the personal data, including protection against unauthorised or unlawful processing and against accidental loss, destruction or damage, using appropriate technical or organisational measures."

Article 32: security of processing. The controller and processor shall implement measures "to ensure a level of security appropriate to the risk, including inter alia as appropriate: the pseudonymisation and encryption of personal data; the ability to ensure the ongoing confidentiality, integrity, availability and resilience of processing systems and services; the ability to restore the availability and access to personal data in a timely manner in the event of a physical or technical incident; a process for regularly testing, assessing and evaluating the effectiveness of technical and organisational measures for ensuring the security of the processing." Notice "appropriate to the risk": this is the risk-based thinking from Risk and Security Controls.

Article 33: breach notification. Article 4(12) defines a personal data breach as "a breach of security leading to the accidental or unlawful destruction, loss, alteration, unauthorised disclosure of, or access to, personal data transmitted, stored or otherwise processed." The controller must notify the supervisory authority "without undue delay and, where feasible, not later than 72 hours after having become aware of it," unless the breach "is unlikely to result in a risk to the rights and freedoms of natural persons." A processor "shall notify the controller without undue delay after becoming aware of a personal data breach."

Notice that a breach is wider than theft: accidental destruction and alteration count too, which matches all three CIA properties.

India: Digital Personal Data Protection Act, 2023 and Rules, 2025

India's law uses its own words: a Data Fiduciary decides why and how personal data is processed (similar to a GDPR controller), a Data Principal is the person the data is about, and the Board is the Data Protection Board of India.

  • Act, section 8(5): "A Data Fiduciary shall protect personal data in its possession or under its control, including in respect of any processing undertaken by it or on its behalf by a Data Processor, by taking reasonable security safeguards to prevent personal data breach."
  • Rules, rule 6(1) repeats this and says the safeguards "shall include, at the minimum": appropriate data security measures such as encryption, obfuscation, masking or virtual tokens; measures to control access to the computer resources used; "visibility on the accessing of such personal data, through appropriate logs, monitoring and review"; reasonable measures for continued processing, "such as by way of data-backups"; retaining those logs and personal data "for a period of one year, unless compliance with any law for the time being in force requires otherwise"; appropriate provisions in contracts with data processors; and appropriate technical and organisational measures.
  • Rules, rule 7(2) requires the Data Fiduciary to tell the Board, "without delay", about a breach (its nature, extent, timing, location and likely impact), and then "within seventy-two hours of becoming aware of the breach, or within such longer period as the Board may allow on a request made in writing" give updated, detailed information. Rule 7(1) separately requires telling each affected person, "without delay," in "a concise, clear and plain manner."
  • Penalties, summarised by India's Press Information Bureau: up to ₹250 crore for failing to maintain reasonable security safeguards, up to ₹200 crore for not notifying the Board or affected individuals of a breach (and for violations on children's data), and up to ₹50 crore for other violations.

When does it apply? The Rules were published in November 2025 and phase in. Under rule 1 of the Rules, rules 1, 2 and 17 to 21 took effect on publication, rule 4 takes effect one year after publication, and "rules 3, 5 to 16, 22 and 23 shall come into force eighteen months after the date of publication," which is around May 2027. Rules 6 and 7 are in that last group, so the detailed security and breach-notification rules above are not yet in force as this is written (October 2026). Check the current status before relying on any date.

Compare the two on breach timing

GDPR India DPDP Rules, 2025
Who is told The competent supervisory authority The Board and each affected person
Clock Within 72 hours, where feasible, unless unlikely to result in risk Description to the Board without delay; detailed information within 72 hours
Threshold Not required if unlikely to result in a risk The rule applies "on becoming aware of any personal data breach"

The headline number is the same, 72 hours, but the structure differs, so do not assume one country's process satisfies the other's.


10. When a breach happens: the first hour

This is a plain checklist, not legal advice.

  1. Contain it: disable the affected account or key, take the system offline if necessary, preserve logs.
  2. Record the time you became aware: legal clocks run from awareness.
  3. Find out what data was involved and how many people it affects.
  4. Tell the right people inside the organisation: security lead, data protection or legal contact.
  5. Notify the regulator and affected people as the law that applies to you requires.
  6. Fix and learn: close the cause, restore from clean backups, and review which principle or control failed.

11. Try it yourself

  1. Inventory a small app. For a to-do or sign-up app, list every piece of personal data it collects, where it is stored, who can read it and how long it is kept. Delete one field you cannot justify.
  2. Classify. Give each item a label (public, internal, confidential, restricted) and a CIA rating (low, moderate, high) like FIPS 199.
  3. Decide per field: keep as-is, mask, tokenise, pseudonymise or drop?
  4. Check the three states: where is each item encrypted at rest, in transit, and what exposes it in use (logs, error pages, screenshots)?
  5. Plan disposal: what happens to the data when a user deletes their account, and to the backups?

12. Common mistakes

Mistake The better view
"Encrypted means safe" Encryption protects data at rest or in transit; it does not stop a user or application with access from misusing it
"Hashing or removing names makes data anonymous" If it can be linked back, it is still personal data; test re-identification risk
"Pseudonymised data is outside privacy law" Under GDPR recital 26 it is still information on an identifiable person
"Delete means gone" Sanitise or destroy media, and remember backups
"Privacy is the lawyers' job" Collecting less, setting defaults and controlling access are design decisions
"Logs are harmless" Logs often hold personal data and credentials; protect them and limit what goes in
"One country's breach process covers all" Rules and clocks differ; know which laws apply to your users

Closing

Data security keeps data confidential, correct and available. Privacy asks whether you should have the data at all and whether you are using it fairly. The best controls combine both: know your data, classify it, collect less, protect it in every state, reduce it with masking and pseudonymisation, dispose of it properly, and be ready to report a breach on time.

Keep these points:

  • Classify first. You cannot protect data you have not found.
  • Protect all three states: at rest, in transit, in use.
  • Pseudonymised is not anonymous; anonymisation is a strong claim that must be tested.
  • Less data, less risk. Minimisation is the cheapest control.
  • Sanitise before disposal, and test your backups.
  • Know the clocks: GDPR's 72 hours, and India's Rule 7 once in force.

If you can take any app and list what personal data it holds, how that data is protected in each state, what you would do with a breach and who must be told within what time, you understand this writeup.