R Interface to the 'OpenFHE' Fully Homomorphic Encryption Library

Provides an R interface to 'OpenFHE', the open-source C++ library for fully homomorphic encryption (Al Badawi and others, 2022) < https://eprint.iacr.org/2022/915>, which allows computation directly on encrypted data without access to the secret key. Supports the Brakerski-Fan-Vercauteren (BFV, 2012) < https://eprint.iacr.org/2012/144>, Brakerski-Gentry-Vaikuntanathan (BGV, 2014) , and Cheon-Kim-Kim-Song (CKKS, 2017) < https://eprint.iacr.org/2016/421> schemes for arithmetic on encrypted numbers, together with the Ducas-Micciancio (FHEW, 2015) < https://eprint.iacr.org/2014/816> and Chillotti-Gama-Georgieva-Izabachene (TFHE, 2020) < https://eprint.iacr.org/2018/421> schemes for evaluating arbitrary functions on encrypted bits.


openfhe.R

CRAN status R-CMD-check CRAN downloads

This is an interface to the Fully Homomorphic Encryption library developed by OpenFHE.

The companion package homomorpheR (version >= 1.0, soon to be on CRAN) imports this package and includes a number of illustrative vignettes. Specifically, the examples demonstrate how to use existing R functions and optimizers to implement a homomorphic-encryption protocol across multiple sites.

Schemes

  • BFV / BGV: exact integer arithmetic
  • CKKS: approximate real-number arithmetic (with sin, cos, logistic, bootstrapping)
  • FHEW / TFHE (BinFHE): Boolean circuit evaluation

All four FHE subsystems (BFV, BGV, CKKS, BinFHE) are exposed. In addition, we provide facilities for serialization, threshold FHE, CKKS bootstrapping, transcendental function evaluation, and CKKS hoisted (fast) rotations.

Quick Start

library(openfhe.R)

# BFV: exact integer arithmetic
cc <- fhe_context("BFV", plaintext_modulus = 65537, multiplicative_depth = 2)
keys <- key_gen(cc, eval_mult = TRUE)

ct1 <- encrypt(keys@public, make_packed_plaintext(cc, 1:8), cc = cc)
ct2 <- encrypt(keys@public, make_packed_plaintext(cc, 10:17), cc = cc)

# Compute on encrypted data
result <- decrypt(ct1 + ct2, keys@secret, cc = cc)
get_packed_value(result)[1:8]
#> [1] 11 13 15 17 19 21 23 25

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("openfhe.R")

1.5.1.2 by Balasubramanian Narasimhan, a month ago


https://openfheorg.github.io/openfhe.R/, https://github.com/openfheorg/openfhe.R


Report a bug at https://github.com/openfheorg/openfhe.R/issues


Browse source code at https://github.com/cran/openfhe.R


Authors: Balasubramanian Narasimhan [aut, cre, cph] (ORCID: , New Jersey Institute of Technology [cph] (OpenFHE C++ library , inst/openfhe/src) , Duality Technologies , Inc. [ctb, cph] (OpenFHE C++ library , inst/openfhe/src) , Samuel Neves [ctb, cph] (BLAKE2 reference implementation , inst/openfhe/src/core) , Jean-Philippe Aumasson [ctb, cph] (BLAKE2X reference implementation , inst/openfhe/src/core) , Randolph Voorhies [ctb, cph] (cereal serialization library , inst/openfhe/cereal) , Shane Grant [ctb, cph] (cereal serialization library , inst/openfhe/cereal) , Juan Pedro Bolivar Puente [ctb, cph] (cereal std::optional and std::variant support) , THL A29 Limited , a Tencent company [cph] (RapidJSON , bundled in inst/openfhe/cereal) , Milo Yip [ctb, cph] (RapidJSON , bundled in inst/openfhe/cereal) , Alexander Chemeris [ctb, cph] (msinttypes , bundled in inst/openfhe/cereal) , Marcin Kalicinski [ctb, cph] (RapidXml , bundled in inst/openfhe/cereal) , Rene Nyffenegger [ctb, cph] (base64 encoder/decoder , bundled in inst/openfhe/cereal)


Documentation:   PDF Manual  


BSD_2_clause + file LICENSE license


Imports S7, cli, rlang, methods

Suggests tinytest, knitr, rmarkdown

Linking to cpp11

System requirements: cmake (>= 3.16), GNU make, C++17


Imported by homomorpheR.


See at CRAN