Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

implementing-homomorphic-encryption

БесплатноЗапускает вложенные скриптыНе проверен

Guide to implementing homomorphic encryption for privacy-preserving computation under GDPR. Covers scheme selection (BFV, BGV, CKKS, TFHE), Microsoft SEAL…

onfire7777от onfire7777★ 17 звёзд на GitHub

Об этом скилле

Implementing Homomorphic Encryption

Overview

Homomorphic encryption (HE) enables computation on encrypted data without decryption. The data owner encrypts their data, sends the ciphertext to a computing party (e.g., a cloud processor under Article 28), and the computing party performs operations on the ciphertext. The encrypted results are returned to the data owner, who decrypts them to obtain the plaintext result. At no point does the computing party see unencrypted data.

This directly supports GDPR Article 32(1)(a), which identifies encryption as an appropriate technical measure, and Article 25(1), which requires data protection by design. HE enables a controller to outsource computation to a processor while maintaining cryptographic confidentiality of personal data.

HE Scheme Selection

Scheme Comparison

Scheme Arithmetic Type Exact/Approximate Operations Best For Libraries
BFV Integer (modular) Exact Add, Multiply (limited depth) Counting, matching, exact integer computation Microsoft SEAL, OpenFHE
BGV Integer (modular) Exact Add, Multiply (with modulus switching) Deep circuits on integers, batched operations HELib, OpenFHE
CKKS Real/Complex Approximate Add, Multiply, Rotation ML inference, statistical analysis, floating-point computation Microsoft SEAL, OpenFHE, HEAAN
TFHE Boolean/Integer Exact Arbitrary (gate-by-gate) Programmable bootstrapping, arbitrary functions TFHE-rs, Concrete (Zama)

Decision Criteria

Criterion BFV/BGV CKKS TFHE
Need exact results? Yes No (approximate) Yes
Data type Integers Real numbers Boolean/Small integers
Multiplicative depth Limited (plan ahead) Limited (plan ahead) Unlimited (with bootstrapping)
SIMD batching Yes (thousands of slots) Yes (thousands of slots) Limited
Performance Fast for shallow circuits Fast for ML workloads Slow per operation, fast bootstrapping
Typical latency Milliseconds (shallow) to seconds Milliseconds to seconds Seconds to minutes

Parameter Selection Guide

For BFV/CKKS with Microsoft SEAL, the key parameters are:

Parameter Description Security Impact Performance Impact
poly_modulus_degree (N) Degree of the polynomial ring Higher N = more security Higher N = slower operations, more memory
coeff_modulus Product of primes defining the coefficient modulus Determines noise budget and multiplicative depth More primes = deeper circuits but larger ciphertexts
plain_modulus (BFV only) Modulus for plaintext encoding Must accommodate plaintext values Larger = less noise budget available
scale (CKKS only) Encoding scale factor Determines precision of approximate results Higher scale = more precision but faster noise growth

Recommended parameter sets (128-bit security):

Use Case N coeff_modulus bits Mult Depth Memory/Ciphertext
Simple addition/comparison 4096 [40, 40] 1 ~64 KB
Moderate computation (sum + multiply) 8192 [60, 40, 40, 60] 2-3 ~256 KB
ML inference (logistic regression) 16384 [60, 40, 40, 40, 40, 60] 4-5 ~1 MB
Deep neural network inference 32768 [60, 40×8, 60] 8+ ~4 MB

Architecture for GDPR-Compliant HE Processing

┌────────────────────────────────────────────────────────────┐
│              Data Controller (Prism Data Systems AG)        │
│  ┌──────────────────┐  ┌──────────────────────────────┐   │
│  │ Key Generator     │  │ Encrypt personal data        │   │
│  │ (sk stays here)   │  │ with public key              │   │
│  └────────┬─────────┘  └──────────┬───────────────────┘   │
│           │ pk, rlk, gk           │ ciphertext             │
└───────────┼───────────────────────┼────────────────────────┘
            │                       │
            ▼                       ▼
┌────────────────────────────────────────────────────────────┐
│              Data Processor (Cloud Service)                  │
│  ┌──────────────────────────────────────────────────────┐  │
│  │ Compute on ciphertext using pk, rlk, gk              │  │
│  │ (NEVER has access to sk — cannot decrypt)             │  │
│  │                                                        │  │
│  │ Operations: HE.Add, HE.Multiply, HE.Rotate           │  │
│  └──────────────────────────┬───────────────────────────┘  │
│                              │ encrypted result             │
└──────────────────────────────┼─────────────────────────────┘
                               │
                               ▼
┌────────────────────────────────────────────────────────────┐
│              Data Controller (Prism Data Systems AG)        │
│  ┌─────────
Полный SKILL.md на GitHub

Установить implementing-homomorphic-encryption в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

Вложенные файлы

assets/template.mdreferences/standards.mdreferences/workflows.mdscripts/process.py

FAQ

Что делает скилл implementing-homomorphic-encryption?

Guide to implementing homomorphic encryption for privacy-preserving computation under GDPR. Covers scheme selection (BFV, BGV, CKKS, TFHE), Microsoft SEAL, IBM HELib, and Google FHE transpiler. Includes performance benchmarks, parameter tuning, and basic HE example code for encrypted arithmetic operations.

Как установить скилл implementing-homomorphic-encryption?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл implementing-homomorphic-encryption запускает скрипты?

Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.

Похожие скиллы

Сравнить implementing-homomorphic-encryption с