# About security bits

**URL:** <https://openfhe.discourse.group/t/about-security-bits/492>\
**Category:** FHE Questions\
**Created:** [April 27, 2023, 3:34pm UTC](https://openfhe.discourse.group/t/about-security-bits/492 "2023-04-27T15:34:17Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![marc-alonso](https://avatars.discourse-cdn.com/v4/letter/m/6f9a4e/32.png) [@marc-alonso](https://openfhe.discourse.group/u/marc-alonso)\
**Post date:** [April 27, 2023, 3:34pm UTC](https://openfhe.discourse.group/t/about-security-bits/492/1 "2023-04-27T15:34:17Z")

</div>

Hello everyone. 😃

I have a generic FHE question on security bits.  
What does it mean when we want the parameter \gamma=128 bits?

What does \gamma represent in practice? The length of the secret key?

---

<div class="post-metadata">

**Author:** ![Caesar](https://yyz1.discourse-cdn.com/flex031/user_avatar/openfhe.discourse.group/caesar/32/63_2.png) [@Caesar](https://openfhe.discourse.group/u/Caesar)\
**Post date:** [April 27, 2023, 9:53pm UTC](https://openfhe.discourse.group/t/about-security-bits/492/2 "2023-04-27T21:53:47Z")

</div>

\lambda is the security level measured in bits which denotes the log\_2{} number of elementary operations the adversary needs to do to break the system by the most efficient known lattice attack with probability 1. For \lambda = 128, the adversary would need 2^{128} elementary operations to break the cryptosystem with probability 1.

Note that in OpenFHE, the secret key length is not equal to \lambda, it is actually larger than that and it depends on multiple factors.

More on this can be found [here](https://eprint.iacr.org/2015/046.pdf).

---

<div class="post-metadata">

**Author:** ![marc-alonso](https://avatars.discourse-cdn.com/v4/letter/m/6f9a4e/32.png) [@marc-alonso](https://openfhe.discourse.group/u/marc-alonso)\
**Post date:** [April 29, 2023, 3:59pm UTC](https://openfhe.discourse.group/t/about-security-bits/492/3 "2023-04-29T15:59:25Z")

</div>

Thank you, now it is clearer. One last question: in order to obtain the value of \gamma for a given crypto context how should we do it? log2 of the modulus q ?

---

<div class="post-metadata">

**Author:** ![Caesar](https://yyz1.discourse-cdn.com/flex031/user_avatar/openfhe.discourse.group/caesar/32/63_2.png) [@Caesar](https://openfhe.discourse.group/u/Caesar)\
**Post date:** [April 29, 2023, 4:59pm UTC](https://openfhe.discourse.group/t/about-security-bits/492/4 "2023-04-29T16:59:17Z")

</div>

That depends on the scheme parameters and the attack used to break it.  
There are open-source tools that can compute \lambda for you. Check [this](https://github.com/malb/lattice-estimator).

Theoretical details can be found in the referenced paper above.

---

<div class="post-metadata">

**Author:** ![marc-alonso](https://avatars.discourse-cdn.com/v4/letter/m/6f9a4e/32.png) [@marc-alonso](https://openfhe.discourse.group/u/marc-alonso)\
**Post date:** [June 26, 2023, 9:32am UTC](https://openfhe.discourse.group/t/about-security-bits/492/5 "2023-06-26T09:32:13Z")

</div>

By using a CKKSRNS with ring dim of 2^16 and sparse packing (2^14), is my LWE instance correct like this:

`LWEParameters(n=16384, q=65536, Xs=D(σ=3.19), Xe=D(σ=3.19))`

?

---

<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:** [June 27, 2023, 3:41pm UTC](https://openfhe.discourse.group/t/about-security-bits/492/6 "2023-06-27T15:41:29Z")

</div>

I suggest asking this question at [GitHub - malb/lattice-estimator: An attempt at a new LWE estimator](https://github.com/malb/lattice-estimator), as it is specific the `lattice estimator` tool.
