This document explains the FheAsciiString type for handling encrypted strings in TFHE-rs.
TFHE-rs has supports for ASCII strings with the type FheAsciiString. You can enable this feature using the flag: --features=strings
Strings are not yet compatible with CompactCiphertextList
and CompressedCiphertextList
A variety of common operations are supported for FheAsciiString
. These include:
Comparisons: eq
, ne
, lt
, le
, gt
, ge
, eq_ignore_case
Case conversion: to_lowercase
/ to_uppercase
String checks: starts_with
/ ends_with
/ contains
Trimming: trim_start
/ trim_end
/ trim
Prefix/suffix operations: strip_prefix
/ strip_suffix
Search: find
/ rfind
When encrypting strings, you can add padding to hide the actual length of strings. The null character (b'\0') is used as the padding. Here is an example: