# Accessing Specific Plaintext Indexes

**URL:** <https://openfhe.discourse.group/t/accessing-specific-plaintext-indexes/397>\
**Category:** Library Questions\
**Created:** [March 7, 2023, 3:40pm UTC](https://openfhe.discourse.group/t/accessing-specific-plaintext-indexes/397 "2023-03-07T15:40:09Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Bernardo\_Ramalho](https://yyz1.discourse-cdn.com/flex031/user_avatar/openfhe.discourse.group/bernardo_ramalho/32/92_2.png) [@Bernardo\_Ramalho](https://openfhe.discourse.group/u/Bernardo_Ramalho)\
**Post date:** [March 7, 2023, 3:40pm UTC](https://openfhe.discourse.group/t/accessing-specific-plaintext-indexes/397/1 "2023-03-07T15:40:09Z")

</div>

Hello,

So after computing additions and rotation on ciphertexts and decrypting the final ciphertext, I get the following Plaintext: `( 77 62 44 23 ... ) `.

My question is if there is any way for me to access only the first value. In the documentation of Plaintext, there is no reference to methods or attributes that I can interact with.

---

<div class="post-metadata">

**Author:** ![iquah](https://yyz1.discourse-cdn.com/flex031/user_avatar/openfhe.discourse.group/iquah/32/8_2.png) [@iquah](https://openfhe.discourse.group/u/iquah)\
**Post date:** [March 7, 2023, 4:46pm UTC](https://openfhe.discourse.group/t/accessing-specific-plaintext-indexes/397/2 "2023-03-07T16:46:57Z")

</div>

That’s because you need to first get the underlying coefficients. Something like the following should work:

```c++

    cc->Decrypt(keys.secretKey, yourCiphertext, &result);
    result->SetLength(originalCiphertextLength);

    std::vector<std::complex<double>> res = result->GetCKKSPackedValue();
    for (auto &el: res){
        std::cout << el << ",";
    }

```

In your case you’d do something like `res[0]`

---

<div class="post-metadata">

**Author:** ![Bernardo\_Ramalho](https://yyz1.discourse-cdn.com/flex031/user_avatar/openfhe.discourse.group/bernardo_ramalho/32/92_2.png) [@Bernardo\_Ramalho](https://openfhe.discourse.group/u/Bernardo_Ramalho)\
**Post date:** [March 7, 2023, 5:20pm UTC](https://openfhe.discourse.group/t/accessing-specific-plaintext-indexes/397/3 "2023-03-07T17:20:07Z")

</div>

Thanks a lot. It makes sense!
