Why Data Protection Laws Exist
Before these laws:
Governments introduced data protection laws to:
What Is Personal Data?
Personal data is any information that can identify a person.
Examples:
If data can identify someone directly or indirectly, it is personal data.
What Is GDPR?
General Data Protection Regulation (GDPR) is a European Union law that took effect in 2018.
Even if a company is not in Europe, GDPR still applies if it:
Main Goals of GDPR:
Key Principles of GDPR (Simplified)
GDPR is built on important principles:
1. Lawfulness, Fairness & Transparency
You must tell users:
2. Purpose Limitation
Collect data only for a specific reason.
3. Data Minimization
Collect only what you need — nothing extra.
4. Accuracy
Keep data correct and updated.
5. Storage Limitation
Don’t keep data longer than necessary.
6. Integrity & Confidentiality
Protect data with proper security measures.
Rights of Individuals Under GDPR
People have powerful rights, including:
Companies must respond to these requests within a specific time (usually 30 days).
What Is NDPR?
Nigeria Data Protection Regulation (NDPR) is Nigeria’s data protection regulation introduced in 2019.
It is similar to GDPR but applies primarily within Nigeria.
NDPR Applies To:
NDPR Key Requirements
NDPR requires organizations to:
Organizations must also appoint a Data Protection Officer (DPO) if they process significant amounts of data.
What Is Consent?
Consent means:
Bad example:
Good example:
Example:
[ ] I agree to the processing of my personal data for marketing purposes.
The user must actively check it.
Data Breach Requirements
A data breach happens when personal data is:
Under GDPR:
Under NDPR:
Penalties for Violations
These laws are serious.
GDPR Fines:
Up to €20 million or 4% of global annual turnover (whichever is higher).
NDPR Penalties:
Fines based on percentage of annual revenue.
This ensures companies take privacy seriously.
Real-World Enforcement Example
Companies like Meta and Google have faced large GDPR fines for privacy violations.
This shows the law is actively enforced.
Practical Example: Compliant Data Collection (Simple Code)
Below is a very basic example of how to properly collect user data with consent in a web application.
Example (Python Flask Web App – Simplified)
from flask import Flask, request, render_template_string
app = Flask(__name__)
html_form = """
<form method="POST">
Name: <input type="text" name="name"><br><br>
Email: <input type="email" name="email"><br><br>
<input type="checkbox" name="consent" required>
I agree to the processing of my personal data.<br><br>
<input type="submit" value="Submit">
</form>
"""
@app.route("/", methods=["GET", "POST"])
def collect_data():
if request.method == "POST":
name = request.form.get("name")
email = request.form.get("email")
consent = request.form.get("consent")
if consent:
return f"Data received for {name}. Consent recorded."
else:
return "Consent is required."
return render_template_string(html_form)
if __name__ == "__main__":
app.run(debug=True)
Why This Is Compliant (Basic Level):
In a real system, you would also:
Compilation of All Code Blocks (Single Combined Code)
from flask import Flask, request, render_template_string
app = Flask(__name__)
html_form = """
<form method="POST">
Name: <input type="text" name="name"><br><br>
Email: <input type="email" name="email"><br><br>
<input type="checkbox" name="consent" required>
I agree to the processing of my personal data.<br><br>
<input type="submit" value="Submit">
</form>
"""
@app.route("/", methods=["GET", "POST"])
def collect_data():
if request.method == "POST":
name = request.form.get("name")
email = request.form.get("email")
consent = request.form.get("consent")
if consent:
return f"Data received for {name}. Consent recorded."
else:
return "Consent is required."
return render_template_string(html_form)
if __name__ == "__main__":
app.run(debug=True)