# The Security of SPARSE\_ENCAPSULATED vs UNIFORM\_TERNARY

**URL:** <https://openfhe.discourse.group/t/the-security-of-sparse-encapsulated-vs-uniform-ternary/2161>\
**Category:** Library Questions\
**Created:** [September 5, 2025, 2:25pm UTC](https://openfhe.discourse.group/t/the-security-of-sparse-encapsulated-vs-uniform-ternary/2161 "2025-09-05T14:25:36Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![seyda](https://yyz1.discourse-cdn.com/flex031/user_avatar/openfhe.discourse.group/seyda/32/397_2.png) [@seyda](https://openfhe.discourse.group/u/seyda)\
**Post date:** [September 5, 2025, 2:25pm UTC](https://openfhe.discourse.group/t/the-security-of-sparse-encapsulated-vs-uniform-ternary/2161/1 "2025-09-05T14:25:36Z")

</div>

TL;DR: Does secretKeyDist SPARSE\_ENCAPSULATED provide the same security as UNIFORM\_TERNARY?

Hi all, I am playing with the sparse-secret encapsulation method in the version v1.4. In the paper [Bootstrapping for Approximate Homomorphic Encryption with Negligible Failure-Probability by Using Sparse-Secret Encapsulation](https://eprint.iacr.org/2022/024) , its security is shown, and I wanted to double-check with you if there are any additional considerations in the practical implementation. My working example is just the src/pke/examples/advanced-ckks-bootstrapping.cpp script with the secretKeyDist set to SPARSE\_ENCAPSULATED. Can I just assume It works at the same security level as UNIFORM\_TERNARY (when all other parameters are the same)? If yes, congrats on the major improvement as I am already seeing +10 bits of precision in various bootstrapping settings!

---

<div class="post-metadata">

**Author:** ![ypolyakov](https://yyz1.discourse-cdn.com/flex031/user_avatar/openfhe.discourse.group/ypolyakov/32/47_2.png) [@ypolyakov](https://openfhe.discourse.group/u/ypolyakov)\
**Post date:** [September 10, 2025, 9:49pm UTC](https://openfhe.discourse.group/t/the-security-of-sparse-encapsulated-vs-uniform-ternary/2161/2 "2025-09-10T21:49:24Z")

</div>

The sparse secrets have lower thresholds than uniform secrets (so less levels can be used to achieve the same level of security). In the sparse-secret setting, the security level is determined by \log Q P for the Hamming weight of 192. See the following except from [General Functional Bootstrapping using CKKS](https://eprint.iacr.org/2024/1623) for the guidelines

 ![image](https://canada1.discourse-cdn.com/flex031/uploads/openfhe/original/1X/0ef0b38f314c0fe720985818fb6d992e1cca4fc3.png)

Note that the sparse secrets are not currently included in the security documents, i.e., [Homomorphic Encryption Standard](https://eprint.iacr.org/2019/939) and [Security Guidelines for Implementing Homomorphic Encryption](https://cic.iacr.org/p/1/4/26). This is why OpenFHE does not use any special tables for sparse secrets (and simply defaults to the parameters for the uniform case). There is an active effort to develop recommendations for sparse secrets and improve their support in the Lattice Estimator. In summary, this mode is only recommended for research purposes at the moment.
