# KeyGeneration\_for\_CKKS\_scheme

**URL:** <https://openfhe.discourse.group/t/keygeneration-for-ckks-scheme/519>\
**Category:** Library Questions\
**Created:** [May 2, 2023, 1:44pm UTC](https://openfhe.discourse.group/t/keygeneration-for-ckks-scheme/519 "2023-05-02T13:44:31Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![chayma](https://avatars.discourse-cdn.com/v4/letter/c/71e660/32.png) [@chayma](https://openfhe.discourse.group/u/chayma)\
**Post date:** [May 2, 2023, 1:44pm UTC](https://openfhe.discourse.group/t/keygeneration-for-ckks-scheme/519/1 "2023-05-02T13:44:31Z")

</div>

Hi guys,  
I wanna test key generation ( both public and secret key ) and parameters selection using CKKS scheme. Under the examples repository, most of files I have found represent functions (addition, multiplication, rotation…) we can apply using CKKS.  
Any help PLEASE !!

---

<div class="post-metadata">

**Author:** ![chayma](https://avatars.discourse-cdn.com/v4/letter/c/71e660/32.png) [@chayma](https://openfhe.discourse.group/u/chayma)\
**Post date:** [May 2, 2023, 2:10pm UTC](https://openfhe.discourse.group/t/keygeneration-for-ckks-scheme/519/2 "2023-05-02T14:10:45Z")

</div>

What is the method used to generate keys ?

---

<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:** [May 2, 2023, 2:25pm UTC](https://openfhe.discourse.group/t/keygeneration-for-ckks-scheme/519/3 "2023-05-02T14:25:28Z")

</div>

> <https://github.com/openfheorg/openfhe-development/blob/main/src/pke/examples/simple-real-numbers.cpp#L135>

---

<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:** [May 3, 2023, 4:51pm UTC](https://openfhe.discourse.group/t/keygeneration-for-ckks-scheme/519/4 "2023-05-03T16:51:46Z")

</div>

Has this been resolved?

---

<div class="post-metadata">

**Author:** ![chayma](https://avatars.discourse-cdn.com/v4/letter/c/71e660/32.png) [@chayma](https://openfhe.discourse.group/u/chayma)\
**Post date:** [May 8, 2023, 1:22pm UTC](https://openfhe.discourse.group/t/keygeneration-for-ckks-scheme/519/5 "2023-05-08T13:22:51Z")

</div>

![image](https://canada1.discourse-cdn.com/flex031/uploads/openfhe/original/1X/1ec5ad2a864ed2d850eb00a0c4ff28bd43d7d623.png)  
Are the printed public and secret keys the values of the public and secret keys themselves, or are they the addresses in memory where these keys are stored?

---

<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:** [May 8, 2023, 2:13pm UTC](https://openfhe.discourse.group/t/keygeneration-for-ckks-scheme/519/6 "2023-05-08T14:13:56Z")

</div>

Addresses! If you look up their underlying implementation you’ll find that they are actually smart pointers 🙂

Click on the “private key” or “public key” (from [Template Class KeyPair — OpenFHE documentation](https://openfhe-development.readthedocs.io/en/latest/api/classlbcrypto_1_1KeyPair.html?highlight=keypair#_CPPv4I0EN8lbcrypto7KeyPairE)) and you should be redirected to smth like [Typedef lbcrypto::PublicKey — OpenFHE documentation](https://openfhe-development.readthedocs.io/en/latest/api/typedef_namespacelbcrypto_1aef16dc584a1aa74d52bfac590d5cf4a9.html#_CPPv4N8lbcrypto9PublicKeyE) where it is shown that `PublicKey = std::shared_ptr<PublicKeyImpl<Element>>`
