# Ring dimension and security level

**URL:** https://openfhe.discourse.group/t/ring-dimension-and-security-level/1231
**Category:** Library Questions
**Created:** [April 25, 2024, 5:03am UTC](https://openfhe.discourse.group/t/ring-dimension-and-security-level/1231 "2024-04-25T05:03:04Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Joker](https://avatars.discourse-cdn.com/v4/letter/j/5f9b8f/32.png) [@Joker](https://openfhe.discourse.group/u/Joker)
#### Post date: [April 25, 2024, 5:03am UTC](https://openfhe.discourse.group/t/ring-dimension-and-security-level/1231/1 "2024-04-25T05:03:04Z")

</div>

I have some difficulties to understand how security level and ring dimension interact.  
In my code I set the security level to 128bit classic and got a ring dimension of 2^17.  
Then, I changed it to 192 and 256bit. I expected a higher ring dimension because it should be more difficult to decrypt these data but it stays at 2^17.  
Is this the intended behavior and if so, could you explain it to me?

---

<div class="post-metadata">

### Author: ![narger](https://yyz1.discourse-cdn.com/flex031/user_avatar/openfhe.discourse.group/narger/32/420_2.png) [@narger](https://openfhe.discourse.group/u/narger)
#### Post date: [April 25, 2024, 1:22pm UTC](https://openfhe.discourse.group/t/ring-dimension-and-security-level/1231/2 "2024-04-25T13:22:11Z")

</div>

> [@Bug in security level?](https://openfhe.discourse.group/t/bug-in-security-level/835):
>
> Hello, I am trying to setup a cryptocontext for CKKS but I am struggling with security levels. In particular, this is the context I am creating: CCParams\<CryptoContextCKKSRNS\> parameters; SecurityLevel securityLevel = lbcrypto::HEStd\_128\_classic; parameters.SetSecretKeyDist(UNIFORM\_TERNARY); parameters.SetSecurityLevel(securityLevel); parameters.SetBatchSize(1 \<\< 14); ScalingTechnique rescaleTech = FLEXIBLEAUTO; usint dcrtBits = 58; usint firstMod = 42; paramet…
