本文へ移動
cccskills
無料GitHub で公開

implementing-secure-multi-party-computation

Implementation guide for secure multi-party computation enabling privacy-preserving analytics across organizations. Covers secret sharing, garbled circuits, reference frameworks MP-SPDZ and CrypTen, practical deployment patterns, and GDPR alignment for joint controller analytics without revealing individual party inputs.

インストール方法を見る

含まれるファイル(5)

  • SKILL.md9.3 KB
  • assets/template.md4.0 KB
  • references/standards.md3.2 KB
  • references/workflows.md5.9 KB
  • scripts/process.py11.8 KB

SKILL.md(原文)

インストールする前に、エージェントに与えられる指示の中身を確認できます。

Implementing Secure Multi-Party Computation

Overview

Secure Multi-Party Computation (SMPC) enables multiple parties to jointly compute a function over their combined inputs while keeping each party's individual input private. No party learns anything beyond the output of the computation and what can be inferred from their own input and the output.

SMPC supports GDPR Article 5(1)(c) data minimization by eliminating the need to centralize data, Article 25(1) data protection by design by building privacy into the computation architecture, and Article 26 joint controller arrangements by enabling collaborative analytics without data sharing.

Core SMPC Techniques

Shamir Secret Sharing

Shamir's Secret Sharing (1979) splits a secret value into n shares such that any t shares can reconstruct the secret (threshold t-out-of-n), but fewer than t shares reveal no information.

Properties:

  • Information-theoretic security (unbreakable regardless of computational power)
  • Supports addition of shared values without communication
  • Multiplication requires an interactive protocol (Beaver triples or resharing)

Application: Splitting personal data across multiple servers such that no single server (or coalition below threshold) can reconstruct the data.

Garbled Circuits

Yao's Garbled Circuits (1986) enable two-party computation. One party (the garbler) encrypts a boolean circuit; the other party (the evaluator) evaluates the encrypted circuit without learning intermediate values.

Properties:

  • Constant-round protocol (efficient for high-latency networks)
  • Communication cost proportional to circuit size
  • Best for two-party computation with complex boolean functions

Oblivious Transfer

Oblivious Transfer (OT) is a protocol where a sender has multiple messages and a receiver selects one message to receive, without the sender learning which message was selected and without the receiver learning the other messages.

Role in SMPC: OT is the foundational building block for garbled circuit evaluation and is used for input wire labels in Yao's protocol.

SMPC Frameworks

FrameworkProtocolLanguageSecurity ModelBest For
MP-SPDZMultiple (SPDZ, MASCOT, semi-honest, malicious)Python-like DSLSemi-honest and maliciousResearch and prototyping with multiple security models
CrypTenSecret sharing (2-party and 3-party)Python (PyTorch)Semi-honestML inference and training on shared data
MOTIONGMW, BMR, arithmetic/boolean sharingC++Semi-honestHigh-performance 2+ party computation
ABY/ABY3Arithmetic, Boolean, Yao sharingC++Semi-honest (2-party ABY, 3-party ABY3)Mixed-protocol computation (switching between share types)
SharemindAdditive secret sharing (3-party)SecreC (DSL)Semi-honest (honest majority)Enterprise deployment with managed infrastructure

MP-SPDZ Protocol Selection

ProtocolSecurity ModelPartiesPreprocessingOnline Performance
SPDZ/MASCOTMalicious (dishonest majority)2+Heavy (OT-based)Fast online phase
Semi2kSemi-honest (dishonest majority)2+ModerateFast
ShamirSemi-honest (honest majority)3+LightVery fast
Rep3Semi-honest (honest majority)3NoneVery fast
MASCOTMalicious (dishonest majority)2+OT-basedModerate
Yao's GCSemi-honest2GarblingFast evaluation

Architecture for GDPR-Compliant SMPC

┌─────────────────────────────────────────────────────────────┐
│                  SMPC Computation Coordinator                │
│              (orchestrates protocol execution)               │
└──────┬─────────────────┬─────────────────┬──────────────────┘
       │                 │                 │
┌──────▼──────┐  ┌───────▼──────┐  ┌──────▼──────┐
│  Party A    │  │  Party B     │  │  Party C    │
│  (Bank)     │  │  (Insurer)   │  │  (Retailer) │
│             │  │              │  │             │
│ Input: x_A  │  │ Input: x_B   │  │ Input: x_C  │
│ Share: [x_A]│  │ Share: [x_B] │  │ Share: [x_C]│
│             │  │              │  │             │
│ Compute on  │  │ Compute on   │  │ Compute on  │
│ local share │  │ local share  │  │ local share │
└──────┬──────┘  └───────┬──────┘  └──────┬──────┘
       │                 │                 │
       └────────────────►│◄────────────────┘
                         │
                  ┌──────▼──────┐
                  │  Output:    │
                  │  f(x_A,x_B, │
                  │    x_C)     │
                  │  (revealed  │
                  │   to all)   │
                  └─────────────┘

Each party learns ONLY the final output f(x_A, x_B, x_C),
NOT the individual inputs of other parties.

Practical Deployment Patterns

Pattern 1: Private Set Intersection (PSI)

Two parties determine which records they have in common without revealing records unique to either party.

Use case: A bank and an insurer identify shared customers for a joint risk assessment without revealing their full customer lists.

StepActionPrivacy Guarantee
1Each party hashes their customer identifiers with a shared keyIndividual identifiers not revealed
2Parties engage in PSI protocol (DH-based or OT-based)Only intersection elements revealed
3For matched records, proceed with joint computation on shared dataNon-matched records remain private

Pattern 2: Private Aggregation

Multiple parties compute aggregate statistics (sum, mean, count) over their combined data without revealing individual contributions.

Use case: Three regional offices of Prism Data Systems AG compute total headcount and average salary without revealing per-office figures.

Pattern 3: Private ML Training

Multiple parties jointly train a machine learning model using SMPC to protect training data during the process.

Use case: Using CrypTen, two hospitals jointly train a logistic regression model on encrypted patient features.

Performance Considerations

FactorImpactMitigation
Network latencySMPC is communication-intensive; high latency increases total timeCo-locate computation nodes; use constant-round protocols (Yao) for WAN
Data sizeCommunication scales with input sizePre-aggregate locally where possible; use sketching
Circuit complexityDeeper circuits require more communication rounds (for GMW)Optimize circuit depth; use Yao for constant rounds
Number of partiesMore parties = more communication pairsUse 3-party protocols with honest majority for efficiency
Security modelMalicious security is 10-100x slower than semi-honestUse semi-honest for trusted consortium members; reserve malicious for adversarial settings

Implementation Workflow

  1. Define the computation — Express the joint function as arithmetic or boolean operations.
  2. Select security model — Semi-honest if all parties are trusted (e.g., consortium members); malicious if adversarial behavior is possible.
  3. Select framework — Choose MP-SPDZ for flexibility, CrypTen for ML workloads, Sharemind for managed enterprise.
  4. Implement protocol — Write the computation in the framework's DSL, test on synthetic data.
  5. Benchmark — Measure end-to-end latency, communication volume, and memory usage.
  6. Deploy — Establish secure communication channels (mTLS), key distribution, and monitoring.
  7. Govern — Execute joint controller agreement (Art. 26), update Article 30 records, document in DPIA.

Key Regulatory References

  • GDPR Article 5(1)(c) — Data minimization (no data centralization needed)
  • GDPR Article 25(1) — Data protection by design
  • GDPR Article 26 — Joint controller arrangements for SMPC consortia
  • GDPR Article 28 — Processor obligations (SMPC coordinator role)
  • GDPR Article 32(1) — Security measures
  • GDPR Recital 78 — Technical measures for data protection
  • ENISA Report: Data Protection Engineering (2022)

レビュー

まだレビューはありません。使ってみた感想をお寄せください。

同じリポジトリのスキル

概要と使いどころ

Implements 42 CFR Part 2 protections for substance use disorder patient records. Covers written consent requirements stricter than HIPAA, re-disclosure prohibition, court order procedures, qualified service organization agreements, and 2024 amendments aligning Part 2 with HIPAA. Keywords: 42 CFR Part 2, substance use disorder, SUD records, re-disclosure, consent, Part 2 amendments.

日本語の概要は準備中です。原文の説明を表示しています。

mukul975/Privacy-Data-Protection-Skills3032026年3月17日 更新

Guides assessment of third-country adequacy decisions under GDPR Article 45 for international data transfers. Covers the current EC adequacy decisions list, adequacy assessment criteria, partial adequacy handling, and monitoring of adequacy decision reviews. Keywords: adequacy decision, Article 45, third country, adequate protection, EC adequacy list.

日本語の概要は準備中です。原文の説明を表示しています。

mukul975/Privacy-Data-Protection-Skills3032026年3月17日 更新

Implements age-gating mechanisms for online services to restrict access based on user age. Covers hard gates versus soft gates, neutral age prompts, re-verification triggers, circumvention prevention, and regulatory requirements under GDPR, COPPA, UK Online Safety Act, and DSA. Keywords: age gate, age restriction, neutral prompt, children, online services, access control.

日本語の概要は準備中です。原文の説明を表示しています。

mukul975/Privacy-Data-Protection-Skills3032026年3月17日 更新

Evaluates and implements age estimation and verification technologies for online services. Covers facial age estimation, digital ID verification, self-declaration with risk assessment, AI-based age estimation, and the accuracy versus privacy tradeoff. Includes ICO guidance and euCONSENT framework. Keywords: age verification, age estimation, facial analysis, digital ID, children, online safety.

日本語の概要は準備中です。原文の説明を表示しています。

mukul975/Privacy-Data-Protection-Skills3032026年3月17日 更新

Preparing EU AI Act compliance documentation for high-risk AI systems. Covers Annex III classification, technical documentation under Art. 11, conformity assessment, risk management systems, and CE marking requirements. Keywords: EU AI Act, high-risk AI, Annex III, conformity assessment, CE marking.

日本語の概要は準備中です。原文の説明を表示しています。

mukul975/Privacy-Data-Protection-Skills3032026年3月17日 更新

Implements GDPR Art. 22 automated decision-making and AI Act Art. 14 human oversight requirements for AI systems. Covers identification of solely automated decisions, meaningful human intervention design, logic explanation mechanisms, and contestation procedures. Keywords: Art. 22, automated decision, human oversight, AI Act, profiling, contestation.

日本語の概要は準備中です。原文の説明を表示しています。

mukul975/Privacy-Data-Protection-Skills3032026年3月17日 更新

mukul975 のスキルをすべて見る

このスキルの問題を報告する