# BGV : using KeySwitch

**URL:** <https://openfhe.discourse.group/t/bgv-using-keyswitch/626>\
**Category:** FHE Questions\
**Created:** [June 12, 2023, 8:19am UTC](https://openfhe.discourse.group/t/bgv-using-keyswitch/626 "2023-06-12T08:19:14Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Lola](https://avatars.discourse-cdn.com/v4/letter/l/ed655f/32.png) [@Lola](https://openfhe.discourse.group/u/Lola)\
**Post date:** [June 12, 2023, 8:19am UTC](https://openfhe.discourse.group/t/bgv-using-keyswitch/626/1 "2023-06-12T08:19:14Z")

</div>

Hello,

I am using Helib and I need to perform KeySwitch operations (i.e. from a ciphertext enc(m, pk\_1), get a new ciphertext enc(m, pk\_2)).  
I see that there are KeySwitching procedures but I don’t understand how to use them in practice…  
Thank you for your time !

---

<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:** [June 12, 2023, 5:44pm UTC](https://openfhe.discourse.group/t/bgv-using-keyswitch/626/2 "2023-06-12T17:44:20Z")

</div>

Can you clarify your question? Do you want to do KeySwitching in HElib or in OpenFHE?

---

<div class="post-metadata">

**Author:** ![Lola](https://avatars.discourse-cdn.com/v4/letter/l/ed655f/32.png) [@Lola](https://openfhe.discourse.group/u/Lola)\
**Post date:** [June 13, 2023, 7:12am UTC](https://openfhe.discourse.group/t/bgv-using-keyswitch/626/3 "2023-06-13T07:12:54Z")

</div>

I need it in HElib please 🙂

---

<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:** [June 13, 2023, 3:11pm UTC](https://openfhe.discourse.group/t/bgv-using-keyswitch/626/4 "2023-06-13T15:11:35Z")

</div>

I’m not sure this is the right place to ask your question. For library-related questions, this discourse is primarily focused on OpenFHE. Since your question is about a different library, you may want to try posting it on their corresponding channel.

But if you have questions about the KeySwitching algorithm, I can help you with that.

---

<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 14, 2023, 2:59am UTC](https://openfhe.discourse.group/t/bgv-using-keyswitch/626/5 "2023-06-14T02:59:14Z")

</div>

My suggestion would be to switch to OpenFHE as HElib is no longer actively supported, and several authors of HElib are contributors to the OpenFHE project. We could answer your library-specific question in this case.

---

<div class="post-metadata">

**Author:** ![Lola](https://avatars.discourse-cdn.com/v4/letter/l/ed655f/32.png) [@Lola](https://openfhe.discourse.group/u/Lola)\
**Post date:** [June 14, 2023, 7:08am UTC](https://openfhe.discourse.group/t/bgv-using-keyswitch/626/6 "2023-06-14T07:08:35Z")

</div>

Ok thank you ! So would it be possible if I switch to OpenFHE to use the KeySwitching procedure kind of like a reencryption key ?  
edit : I just saw that openFHE supports Proxy Re-Encryption so i’ll switch to that, thank you very much (:
