ckks_engine

Module stringfn

Source

About the `stringfn` Module

The `stringfn` module in the ckks_engine crate provides tools for performing operations on encrypted strings. This module extends the CKKS encryption scheme to support string manipulation while preserving the privacy of the data.

Key Features

  • Homomorphic String Length: Compute the length of encrypted strings by counting the number of non-zero coefficients in the encrypted polynomial.
  • String Concatenation: Combine two encrypted strings by appending their encrypted polynomial representations.
  • Substring Extraction: Extract a substring from an encrypted string using Rust range syntax.

How It Works

The `stringfn` module represents strings as polynomials, where each coefficient corresponds to an encoded character. Operations such as concatenation and substring extraction manipulate these coefficients directly, while length computation counts the non-zero coefficients in the polynomial.

By leveraging the underlying CKKS encryption scheme, this module ensures that all string operations are performed securely without exposing the plaintext data.