# Ciphertexts equality testing in CKKS

**URL:** <https://openfhe.discourse.group/t/ciphertexts-equality-testing-in-ckks/1033>\
**Category:** FHE Questions\
**Created:** [January 23, 2024, 3:43pm UTC](https://openfhe.discourse.group/t/ciphertexts-equality-testing-in-ckks/1033 "2024-01-23T15:43:44Z")\
**Posts on this page:** 1\
**Showing post:** 2

<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:** [January 23, 2024, 4:26pm UTC](https://openfhe.discourse.group/t/ciphertexts-equality-testing-in-ckks/1033/2 "2024-01-23T16:26:54Z")

</div>

Most existing FHE schemes, including CKKS, are semantically secure cryptoschemes, that is: given access to the ciphertexts only, negligible information about the plaintext can be deduced, such as message length.

In other words, a cryptoscheme is deemed semantically secure if it satisfies the following: “for any two messages of equal length, the ciphertexts produced by the encryption algorithm are indistinguishable by any efficient adversary”.

Also, note that CKKS encryption is probabilistic, that is, encrypting the same message twice does not generate the same ciphertext with a fairly large probability.

To compare encrypted messages, you will need to evaluate a comparison circuit homomorphically, and by definition, the result will also be encrypted. Thus, adversaries who do not own the secret key should not be able to learn the result of the comparison.

---

_[View the full topic](https://openfhe.discourse.group/t/ciphertexts-equality-testing-in-ckks/1033)._
