# Topic 15: Data Protection, Privacy, and Cryptography

**Fictional Northstar case · self-paced · 45–90 minutes plus optional setup**

## Opening question
Is encoded information protected from disclosure?

## Explain
Data protection combines classification, access, retention and technical controls. Encoding changes representation; encryption protects confidentiality when keys and algorithms are managed appropriately; hashing supports integrity checks but is not reversible encryption. TLS protects a configured transport path, not every endpoint or stored copy. Key custody and recovery can determine whether protected data remains usable.

## Supporting technologies
- **Classification and minimization:** Collect and retain only what the purpose requires.
- **Encoding vs encryption:** Representation is not secrecy.
- **Hashing:** Compare integrity; a hash alone does not authenticate the sender.
- **Certificates and keys:** Validate trust and manage issuance, storage and recovery.

## Scenario
Northstar will publish a lab report. It contains synthetic event IDs, a real-looking password field labeled EXAMPLE and a diagram of a fictional network.

```text
field,publish_decision
synthetic_event_id,allow_with_context
password_or_token,exclude
fictional_diagram,allow
real_person_record,exclude
```

## Hands-on procedure
1. Classify the four fields and remove secret-like values even if they appear harmless.
2. Create two synthetic text files differing by one character.
3. Calculate SHA-256 using an approved local tool or the provided Python example; compare the digests.
4. Explain why a matching digest needs a trusted reference if used to establish authenticity.
5. Design key access and recovery responsibilities for an encrypted fictional backup.
6. Publish only the sanitized synthetic example and explain retention and remaining limitations.

## Expected reasoning and limits
The two different files should yield different SHA-256 digests. The public report excludes credentials and real personal records. A digest match checks against a reference; it does not independently prove who created the file.

## Best practices
- Minimize data and classify before publication.
- Separate key access from encrypted data where appropriate.
- Validate certificates rather than bypass warnings.
- Test authorized recovery and revoke obsolete access.

## Vendors, projects and learning
- [Microsoft](https://learn.microsoft.com/en-us/security/): Data protection and security documentation
- [HashiCorp](https://developer.hashicorp.com/vault/docs): Vault secrets-management example
- [OpenSSL](https://docs.openssl.org/): Open-source cryptography toolkit

## Optional technical extension
Create and inspect a lab certificate using official OpenSSL instructions in a disposable directory. Never import it as a trusted authority on a work device.

## Career practice
Relevant role families to investigate: Security support analyst, Data protection analyst, Systems administrator. No current vacancy or hiring requirement is asserted.

Interview: How do encoding, hashing and encryption serve different purposes?

## Sources
- [Python hashlib](https://docs.python.org/3/library/hashlib.html)

## Portfolio evidence
Use the [portfolio guide](../guides/portfolio.md). Submit original input, decisions, tests, actual results, limitations and source attribution. Clearly label modeled, planned and performed work.

## Suggested prerequisites
Topic 6, Topic 11
