homomorpheR homomorpheR logo

homomorpheR is a package for 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.

Install the released version from CRAN as usual, and development versions via

# remotes::install_github("bnaras/homomorpheR")
install.packages("homomorpheR", repos = c('https://bnaras.r-universe.dev', 'https://cloud.r-project.org'))

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

Distributed statistical modeling under FHE

Gaussian-noise variants

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

A related project is distcomp.

Citing

The package and its protocols are described in

Narasimhan, B. (2026). Fully Homomorphic Encryption for Statistical Modeling. arXiv:2610.04163 [stat.CO]. https://arxiv.org/abs/2610.04163

citation("homomorpheR") gives the BibTeX entry.

Website

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