Agent skill

Implementing Homomorphic Encryption

by mukul975 in mukul975/Privacy-Data-Protection-Skills

Guide to implementing homomorphic encryption for privacy-preserving computation under GDPR.

Apache-2.0Auto-check passedLegal & Compliance

Install Implementing Homomorphic Encryption

skills CLI
$ npx skills add mukul975/Privacy-Data-Protection-Skills --skill implementing-homomorphic-encryption -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install mukul975/Privacy-Data-Protection-Skills implementing-homomorphic-encryption --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/mukul975/Privacy-Data-Protection-Skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/privacy/implementing-homomorphic-encryption .claude/skills/implementing-homomorphic-encryption && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
implementing-homomorphic-encryption
GitHub stars
295
Token cost
~2.2k tokens
SKILL.md length
702 words
Files
5 (incl. scripts, references, assets)
Skills in repo
278
Repo updated
First seen
Licence
Apache-2.0

At a glance

Guide to implementing homomorphic encryption for privacy-preserving computation under GDPR.

  • Works in 7 steps: Identify computation — Define the exact… → Select scheme — Choose BFV for exact… → Estimate circuit depth — Count the… → …
  • Tasks that involve Privacy and GDPR
  • SKILL.md covers Overview, HE Scheme Selection, Architecture for… and Performance Considerations, plus 2 more sections
  • Runs Python scripts from its folder

What it does

Implementing Homomorphic Encryption is an agent skill from mukul975/Privacy-Data-Protection-Skills. 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.

Its SKILL.md is about 2.2k tokens, which your agent loads only when the skill is triggered. The skill folder holds 7 other files, including scripts, reference files and assets (for example `assets/template.md`, `references/standards.md` and `references/workflows.md`).

It sits in Legal & Compliance, covering Privacy and GDPR and Cryptography. The repository describes itself as: 282+ structured privacy & data protection skills for AI agents. GDPR, CCPA, EU AI Act, HIPAA, LGPD, PIPL, DPDP Act. The licence is Apache-2.0.

When your agent uses it

  • Tasks that involve Privacy and GDPR
  • Tasks that involve Cryptography

Example prompts

  • “/implementing-homomorphic-encryption”

Requirements

  • Python 3

Workflow steps

7 steps, taken from the first numbered list in SKILL.md.

  1. Identify computation — Define the exact mathematical function to compute on encrypted data. Express it as additions and multiplications…
  2. Select scheme — Choose BFV for exact integer results, CKKS for approximate real-number results, TFHE for arbitrary boolean/integer…
  3. Estimate circuit depth — Count the maximum number of sequential multiplications in the computation graph. This determines parameter…
  4. Select parameters — Choose poly_modulus_degree and coeff_modulus to support the required depth at 128-bit security.
  5. Implement and test — Implement the computation using an HE library. Test against plaintext reference implementation to verify correctness.
  6. Benchmark — Measure encryption, computation, and decryption latency. Verify memory requirements are within infrastructure limits.
  7. Deploy — Establish key management (secret key in HSM at controller, public keys distributed to processor), monitoring, and audit logging.

What it can do on your machine

Read from SKILL.md and the folder at commit 9b2ef9e. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Ships 1 file in scripts/ (Python), which the agent can run.

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Implementing Homomorphic Encryption loads about 2.2k tokens when it runs, and up to ~4.6k if it reads all its reference files. Until then it costs about 86 tokens; SKILL.md has 702 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~86
When it runs · the whole SKILL.md, loaded when a task matches
~2.2k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~4.6k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); the scripts in this folder are not scanned.

SKILL.md

The full file from mukul975/Privacy-Data-Protection-Skills at commit 9b2ef9e, republished under its Apache-2.0 licence (© mukul975). 702 words, ~2,176 tokens.

Download SKILL.mdSave it as .claude/skills/implementing-homomorphic-encryption/SKILL.md (or your agent's skills folder). This skill also uses 4 other files; get the full folder from GitHub.
name
implementing-homomorphic-encryption
description
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.
license
Apache-2.0
metadata.author
mukul975
metadata.version
1.0
metadata.domain
privacy
metadata.subdomain
privacy-by-design
metadata.tags
homomorphic-encryption, microsoft-seal, ckks, bfv, privacy-preserving-computation

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
SchemeArithmetic TypeExact/ApproximateOperationsBest ForLibraries
BFVInteger (modular)ExactAdd, Multiply (limited depth)Counting, matching, exact integer computationMicrosoft SEAL, OpenFHE
BGVInteger (modular)ExactAdd, Multiply (with modulus switching)Deep circuits on integers, batched operationsHELib, OpenFHE
CKKSReal/ComplexApproximateAdd, Multiply, RotationML inference, statistical analysis, floating-point computationMicrosoft SEAL, OpenFHE, HEAAN
TFHEBoolean/IntegerExactArbitrary (gate-by-gate)Programmable bootstrapping, arbitrary functionsTFHE-rs, Concrete (Zama)
Decision Criteria
CriterionBFV/BGVCKKSTFHE
Need exact results?YesNo (approximate)Yes
Data typeIntegersReal numbersBoolean/Small integers
Multiplicative depthLimited (plan ahead)Limited (plan ahead)Unlimited (with bootstrapping)
SIMD batchingYes (thousands of slots)Yes (thousands of slots)Limited
PerformanceFast for shallow circuitsFast for ML workloadsSlow per operation, fast bootstrapping
Typical latencyMilliseconds (shallow) to secondsMilliseconds to secondsSeconds to minutes
Parameter Selection Guide

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

ParameterDescriptionSecurity ImpactPerformance Impact
poly_modulus_degree (N)Degree of the polynomial ringHigher N = more securityHigher N = slower operations, more memory
coeff_modulusProduct of primes defining the coefficient modulusDetermines noise budget and multiplicative depthMore primes = deeper circuits but larger ciphertexts
plain_modulus (BFV only)Modulus for plaintext encodingMust accommodate plaintext valuesLarger = less noise budget available
scale (CKKS only)Encoding scale factorDetermines precision of approximate resultsHigher scale = more precision but faster noise growth

Recommended parameter sets (128-bit security):

Use CaseNcoeff_modulus bitsMult DepthMemory/Ciphertext
Simple addition/comparison4096[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 inference32768[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)        │
│  ┌──────────────────────────────────────────────────────┐  │
│  │ Decrypt result using sk                               │  │
│  │ Plaintext result = f(data) computed without exposure   │  │
│  └──────────────────────────────────────────────────────┘  │
└────────────────────────────────────────────────────────────┘

Key:
  sk = Secret key (never leaves controller)
  pk = Public key (for encryption and computation)
  rlk = Relinearization keys (for ciphertext multiplication)
  gk = Galois keys (for ciphertext rotation/SIMD operations)

Performance Considerations

Show full SKILL.md (294 more words)Show less
Benchmark Reference (Microsoft SEAL, BFV, N=8192, 128-bit security)
OperationLatencyThroughput (ops/sec)
Key generation50 ms20
Encryption2 ms500
Decryption1 ms1,000
Ciphertext addition0.1 ms10,000
Ciphertext multiplication5 ms200
Relinearization3 ms333
SIMD rotation4 ms250
Optimization Strategies
StrategyBenefitTrade-off
SIMD batchingProcess thousands of values in parallelRequires data to be structured as vectors
Circuit depth minimizationFewer multiplications = less noise, smaller parametersMay require algorithmic redesign
Lazy relinearizationSkip intermediate relinearizationsLarger intermediate ciphertexts
Level-aware computationUse modulus switching to control noiseRequires careful depth planning
Hybrid HE + plaintextPerform non-sensitive operations in plaintextReduces privacy guarantee scope

Implementation Workflow

  1. Identify computation — Define the exact mathematical function to compute on encrypted data. Express it as additions and multiplications (and rotations for SIMD).

  2. Select scheme — Choose BFV for exact integer results, CKKS for approximate real-number results, TFHE for arbitrary boolean/integer functions.

  3. Estimate circuit depth — Count the maximum number of sequential multiplications in the computation graph. This determines parameter requirements.

  4. Select parameters — Choose poly_modulus_degree and coeff_modulus to support the required depth at 128-bit security.

  5. Implement and test — Implement the computation using an HE library. Test against plaintext reference implementation to verify correctness.

  6. Benchmark — Measure encryption, computation, and decryption latency. Verify memory requirements are within infrastructure limits.

  7. Deploy — Establish key management (secret key in HSM at controller, public keys distributed to processor), monitoring, and audit logging.

Key Regulatory References

  • GDPR Article 25(1) — Data protection by design (encryption as a design measure)
  • GDPR Article 32(1)(a) — Encryption as a security measure
  • GDPR Article 28 — Processor obligations (HE enables processing without plaintext exposure)
  • GDPR Recital 83 — Encryption to maintain security
  • ENISA Report: Data Protection Engineering (2022)
  • HomomorphicEncryption.org Standard: Homomorphic Encryption Standardization (2018)

© mukul975, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 4 other files (scripts, references, assets) in skills/privacy/implementing-homomorphic-encryption of mukul975/Privacy-Data-Protection-Skills.

  • SKILL.md
  • assets/template.md
  • references/standards.md
  • references/workflows.md
  • scripts/process.py

Open the folder on GitHubat commit 9b2ef9e

Compare with similar skills

Implementing Homomorphic Encryption next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Implementing Homomorphic Encryption compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Implementing Homomorphic Encryption this skillmukul975/Privacy-Data-Protection-Skills295—~2.2kAutomated safety check: PassApache-2.0
Data Protection And Encryptioncbrock84/headcount2k—~1.3kAutomated safety check: PassMIT
C15tc15t/c15t1.9k1 repos~1.6kAutomated safety check: PassApache-2.0
HIPAA Safe Harbor Coverage Auditmaziyarpanahi/openmed5.5k—~1.7kAutomated safety check: PassApache-2.0
Korean Privacy Termskimlawtech/korean-privacy-terms586—~2.9kAutomated safety check: PassApache-2.0
Gdpr ComplianceSushegaad/Claude-Skills-Governance-Risk-and-Compliance9421 repos~3.9kAutomated safety check: PassMIT

Similar skills

  • Protects data itself rather than the systems around it — classifying what you hold, encrypting in transit and at rest and understanding what each actually defends against, managing keys and their…

    2k GitHub stars~1.3k tokensUpdated 20 days ago
    Legal & ComplianceAuto-check passed
  • C15t

    c15t/c15t

    Work with c15t consent management docs, APIs, and integrations for Next.js, React, and JavaScript.

    1.9k GitHub starsUsed in 1 repo~1.6k tokens
    Legal & ComplianceAuto-check passed
  • Checks OpenMed de-identified clinical text against the 18 HIPAA Safe Harbor identifier categories and reports gaps and residual re-identification risk.

    5.5k GitHub stars~1.7k tokensUpdated today
    Legal & ComplianceAuto-check passed
  • Korean Privacy Terms

    kimlawtech/korean-privacy-terms

    처리방침·이용약관 자동 생성 스킬 패키지 (v4.0). An agent skill from kimlawtech/korean-privacy-terms.

    586 GitHub stars~2.9k tokensUpdated 1 mo ago
    Legal & ComplianceAuto-check passed
  • Gdpr Compliance

    Sushegaad/Claude-Skills-Governance-Risk-and-Compliance

    Expert GDPR compliance assistant covering all four core workflows: (1) auditing code and systems for GDPR violations, (2) drafting GDPR-compliant documents such as privacy policies, Data Processing…

    942 GitHub starsUsed in 1 repo~3.9k tokens
    Legal & ComplianceAuto-check passed
  • Hipaa Compliance

    Sushegaad/Claude-Skills-Governance-Risk-and-Compliance

    Expert HIPAA compliance assistant for healthcare and software contexts.

    942 GitHub starsUsed in 1 repo~2.3k tokens
    Legal & ComplianceAuto-check passed

More from mukul975/Privacy-Data-Protection-Skills

All 278 skills in this repo
  • Age Gating Services

    mukul975/Privacy-Data-Protection-Skills

    Implements age-gating mechanisms for online services to restrict access based on user age.

    295 GitHub stars~3.7k tokensUpdated 6 mo ago
    Auto-check passed
  • AI Data Retention

    mukul975/Privacy-Data-Protection-Skills

    Manages AI model retention and machine unlearning requirements.

    295 GitHub stars~1.9k tokensUpdated 6 mo ago
    Auto-check passed
  • Dpia Mitigation Plan

    mukul975/Privacy-Data-Protection-Skills

    Structures risk mitigation planning and residual risk tracking for Data Protection Impact Assessments under GDPR Article 35(7)(d).

    295 GitHub stars~846 tokensUpdated 6 mo ago
    Auto-check passed
  • Gdpr Accountability

    mukul975/Privacy-Data-Protection-Skills

    Guides implementation of the GDPR accountability principle under Articles 5(2) and 24, including documentation requirements for policies, DPIAs, RoPA, training records, and breach logs.

    295 GitHub stars~1.9k tokensUpdated 6 mo ago
    Auto-check passed
  • Pia Threshold Screening

    mukul975/Privacy-Data-Protection-Skills

    Conducts pre-DPIA threshold screening to determine whether a full Data Protection Impact Assessment is required under GDPR Article 35.

    295 GitHub stars~880 tokensUpdated 6 mo ago
    Auto-check passed
  • Retention Schedule

    mukul975/Privacy-Data-Protection-Skills

    Designs and implements data retention schedules compliant with GDPR Article 5(1)(e) storage limitation principle.

    295 GitHub stars~3.3k tokensUpdated 6 mo ago
    Auto-check passed

Questions about Implementing Homomorphic Encryption

What does Implementing Homomorphic Encryption do?

Guide to implementing homomorphic encryption for privacy-preserving computation under GDPR. Implementing Homomorphic Encryption is an agent skill from mukul975/Privacy-Data-Protection-Skills. Guide to implementing homomorphic encryption for privacy-preserving computation under GDPR.

When should I use Implementing Homomorphic Encryption?

Implementing Homomorphic Encryption fits situations like: tasks that involve Privacy and GDPR; tasks that involve Cryptography.

How do I install Implementing Homomorphic Encryption in Claude Code?

Run `npx skills add mukul975/Privacy-Data-Protection-Skills --skill implementing-homomorphic-encryption -a claude-code`. Or copy the skill folder (skills/privacy/implementing-homomorphic-encryption in mukul975/Privacy-Data-Protection-Skills) into .claude/skills/implementing-homomorphic-encryption in your project. Claude Code loads it when a task matches its description.

How do I install Implementing Homomorphic Encryption in Codex?

Run `npx skills add mukul975/Privacy-Data-Protection-Skills --skill implementing-homomorphic-encryption -a codex`. Or copy the skill folder (skills/privacy/implementing-homomorphic-encryption in mukul975/Privacy-Data-Protection-Skills) into .agents/skills/implementing-homomorphic-encryption in your project. Codex loads it when a task matches its description.

Can I use Implementing Homomorphic Encryption in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add mukul975/Privacy-Data-Protection-Skills --skill implementing-homomorphic-encryption -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/implementing-homomorphic-encryption, .gemini/skills/implementing-homomorphic-encryption, .github/skills/implementing-homomorphic-encryption and .opencode/skills/implementing-homomorphic-encryption in your project.

What does Implementing Homomorphic Encryption need to run?

Going by SKILL.md and its folder, Implementing Homomorphic Encryption needs Python for the scripts in its folder. Our summary lists: Python 3.

Does Implementing Homomorphic Encryption access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Implementing Homomorphic Encryption safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.

What licence does Implementing Homomorphic Encryption use?

Implementing Homomorphic Encryption is published under the Apache-2.0 licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Implementing Homomorphic Encryption use?

About 2.2k tokens (SKILL.md is roughly 8.7k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 2.5k tokens, read only when the agent opens those files.

What are the alternatives to Implementing Homomorphic Encryption?

Skills that share tags, products or a category with Implementing Homomorphic Encryption: Data Protection And Encryption (cbrock84/headcount, 2k stars), C15t (c15t/c15t, 1.9k stars), HIPAA Safe Harbor Coverage Audit (maziyarpanahi/openmed, 5.5k stars) and Korean Privacy Terms (kimlawtech/korean-privacy-terms, 586 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Implementing Homomorphic Encryption?

mukul975 (a GitHub user) maintains it in mukul975/Privacy-Data-Protection-Skills, which has 295 GitHub stars. The repository holds 278 skills in this directory. The repository was last updated on March 16, 2026.

Source: mukul975/Privacy-Data-Protection-Skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.