Skip to main content

Data Privacy

Comprehensive data privacy implementation in Oneliac.

Privacy Principles

  1. Data Minimization: Collect only necessary information
  2. Purpose Limitation: Use data only for stated purposes
  3. Storage Limitation: Retain data only as long as needed
  4. Accuracy: Maintain accurate and up-to-date records
  5. Integrity and Confidentiality: Protect against unauthorized access

Patient Data Protection

Anonymization

Patient identifiers are hashed:

from oneliac.privacy import PatientAnonymizer

anonymizer = PatientAnonymizer()

patient_hash = anonymizer.hash_patient(
ssn="123-45-6789",
dob="1980-01-01",
name="John Doe"
)

De-identification

HIPAA de-identification standards:

  • Remove direct identifiers
  • Remove dates (except year)
  • Remove location data below state level
  • Remove health plan information

Encryption

At Rest

All stored data encrypted with AES-256:

from oneliac.encryption import DataEncryption

encryptor = DataEncryption(algorithm="AES-256-GCM")

encrypted_data = encryptor.encrypt(
plaintext=patient_data,
key=encryption_key
)

In Transit

All data transmitted over TLS 1.3:

# All API calls use HTTPS with TLS 1.3
curl -I https://api.oneliac.com

Access Control

Role-Based Access Control (RBAC)

from oneliac.auth import RoleManager

roles = {
"doctor": ["read_patient_data", "prescribe"],
"nurse": ["read_patient_data"],
"admin": ["all_permissions"]
}

Audit Logging

All data access logged:

from oneliac.audit import AccessLog

access_log = AccessLog()

access_log.log_access(
user_id="user_123",
action="view_patient_record",
patient_id="patient_abc123",
timestamp="2025-01-01T00:00:00Z",
status="success"
)

Zero-Knowledge Proofs

Patient data never exposed to verifiers:

from oneliac.zk import ZKProofGenerator

generator = ZKProofGenerator()

# Generate proof without exposing raw data
proof = generator.generate_eligibility_proof(
patient_hash="hash_abc123",
eligibility_criteria={"covered_procedures": ["99213"]}
)

Differential Privacy

Add statistical noise to protect individual privacy:

from oneliac.privacy import DifferentialPrivacy

dp = DifferentialPrivacy(epsilon=0.1)

private_aggregates = dp.add_noise(
aggregated_data=aggregates,
sensitivity=1.0
)

Data Retention Policies

Data TypeRetention PeriodDeletion Method
Patient RecordsPer state law (typically 7 years)Cryptographic erasure
Logs90 daysShredding algorithm
Backups30 daysSecure deletion
Audit Trails7 yearsImmutable on blockchain

GDPR Compliance

Right to Access

# Users can request their data
gdpr_request = gdpr_handler.get_user_data(user_id)

Right to Deletion

# Users can request deletion (right to be forgotten)
gdpr_handler.delete_user_data(user_id)

Data Portability

# Users can export their data
export = gdpr_handler.export_user_data(user_id, format="json")

HIPAA Compliance

Business Associate Agreements (BAA)

All third-party integrations require BAA:

  • IPFS providers
  • Database providers
  • Cloud infrastructure

Security Rule Compliance

  • Administrative safeguards
  • Physical safeguards
  • Technical safeguards
  • Organizational policies

Privacy by Design

  • Minimum necessary information collected
  • End-to-end encryption default
  • User consent required for data processing
  • Regular privacy impact assessments

Incident Response

Data Breach Protocol

  1. Identify breach
  2. Assess scope and severity
  3. Notify affected individuals (within 60 days for HIPAA)
  4. Notify regulatory authorities
  5. Document incident
  6. Post-incident analysis

Third-Party Data Processors

All data processors:

  • Execute Data Processing Agreements (DPA)
  • Implement equivalent security measures
  • Submit to regular audits
  • Notify of any breaches within 24 hours