# Is there a way to perform a plaintext-ciphertext comparison on CKKS?

**URL:** <https://openfhe.discourse.group/t/is-there-a-way-to-perform-a-plaintext-ciphertext-comparison-on-ckks/1397>\
**Category:** FHE Questions\
**Created:** [July 2, 2024, 2:52am UTC](https://openfhe.discourse.group/t/is-there-a-way-to-perform-a-plaintext-ciphertext-comparison-on-ckks/1397 "2024-07-02T02:52:26Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![capibala](https://avatars.discourse-cdn.com/v4/letter/c/b5ac83/32.png) [@capibala](https://openfhe.discourse.group/u/capibala)\
**Post date:** [July 2, 2024, 2:52am UTC](https://openfhe.discourse.group/t/is-there-a-way-to-perform-a-plaintext-ciphertext-comparison-on-ckks/1397/1 "2024-07-02T02:52:26Z")

</div>

Assuming that the server has a plaintext threshold, how can users transmit ciphertext to the server and have the server complete the comparison of plaintext and ciphertext in batches?

---

<div class="post-metadata">

**Author:** ![andreea.alexandru](https://yyz1.discourse-cdn.com/flex031/user_avatar/openfhe.discourse.group/andreea.alexandru/32/378_2.png) [@andreea.alexandru](https://openfhe.discourse.group/u/andreea.alexandru)\
**Post date:** [July 2, 2024, 7:56am UTC](https://openfhe.discourse.group/t/is-there-a-way-to-perform-a-plaintext-ciphertext-comparison-on-ckks/1397/2 "2024-07-02T07:56:58Z")

</div>

Computations at the server side are the foremost application of FHE. Look at the serialization examples from [openfhe-development/src/pke/examples at main · openfheorg/openfhe-development · GitHub](https://github.com/openfheorg/openfhe-development/tree/main/src/pke/examples) to see how to transmit the evaluation keys and ciphertexts from the user to the server. At the server you can process the ciphertexts however it is necessary. In general, you would subtract the server’s plaintext from the user’s ciphertext and then perform the comparison with zero, either through polynomial approximation or through scheme switching.
