Homomorphic Computations in R

Privacy-preserving statistics across sites that never share their data, using fully homomorphic encryption through the 'openfhe.R' interface to OpenFHE (CKKS, BFV, BGV), with n-of-n threshold key generation so that no single party can decrypt. Ships master/worker primitives that let ordinary R modeling code run across sites, and a frozen implementation of the Paillier additive scheme kept for backward compatibility.


homomorpheR homomorpheR logo

R-CMD-check CRAN_Status_Badge

homomorpheR is privacy-preserving statistics across sites that never share their data. It uses fully homomorphic encryption through the openfhe.R interface to OpenFHE — CKKS for real-valued arithmetic, BFV and BGV for exact integers — with n-of-n threshold key generation so that no single party can decrypt. On top of these it ships master/worker primitives that let ordinary R modeling code — stats4::mle(), stratified survival::coxph(), convex programs via CVXR — run across sites. A frozen implementation of the Paillier additive scheme is kept for backward compatibility.

The version on CRAN is 0.3, the Paillier-only release; this development version is a rewrite on OpenFHE. Install it, with its dependencies, by

remotes::install_github("bnaras/homomorpheR", ref = "v1.0")

The cox and cvxr vignettes also use survival and CVXR, which are suggested rather than imported:

install.packages(c("survival", "CVXR"))

The vignettes build up from a gentle introduction to complete distributed protocols:

Getting started

  • introduction — a quick tour of homomorphic computation in R.
  • precision — which encrypted computations are exact and which are approximate.
  • privacy-preserving-aggregation — exact integer aggregation under BFV.
  • query-count-threshold — a count across sites under threshold keys.
  • mle — homomorphic maximum-likelihood estimation for a Poisson parameter.

Distributed statistical modeling under FHE

  • cox — stratified Cox regression distributed across sites under CKKS.
  • cox-threshold — the same fit under n-of-n threshold key generation, so no single party can decrypt.
  • cvxr-cox-lasso-dlbcl — a Cox-lasso fit by consensus ADMM, with CVXR at each site, under threshold FHE on the DLBCL gene-expression data.
  • secure-inference — two-party encrypted prediction.
  • encrypted-regression — logistic regression on encrypted data via a Chebyshev sigmoid approximation.
  • similarity — federated cosine-similarity retrieval with site-private fine-tuned models.

Gaussian-noise variants

  • cox-threshold-dp, cvxr-consensus-admm-dp — the threshold-FHE protocols above with site-side Gaussian noise. Demonstrations, not a privacy guarantee.

Legacy Paillier vignettes. These no longer ship with the package. They are kept in the paillier-archive/ directory of this repository.

  • homomorphing — Paillier homomorphic computations.
  • DHCox — distributed Cox regression via Paillier.
  • QueryNCP — query count with non-cooperating parties.
  • DHCoxNCP — distributed Cox with non-cooperating parties.

A related project is distcomp.

Website

You can view everything, including documentation and vignettes on the homomorpheR website.

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.

install.packages("homomorpheR")

1.0 by Balasubramanian Narasimhan, 14 days ago


https://bnaras.github.io/homomorpheR/


Report a bug at https://github.com/bnaras/homomorpheR/issues


Browse source code at https://github.com/cran/homomorpheR


Authors: Balasubramanian Narasimhan [aut, cre, cph]


Documentation:   PDF Manual  


MIT + file LICENSE license


Imports S7, cli, gmp, openfhe.R, rlang, sodium

Suggests knitr, kableExtra, rmarkdown, survival, CVXR, tinytest


Imported by distcomp.


See at CRAN