In one exemplary embodiment of the invention, a method and
computer program include: receiving first and second ciphertexts having first and second data encrypted per an
encryption scheme, the
encryption scheme has public / secret keys and
encryption, decryption, operation and refresh functions, the encryption function encrypts data, the decryption decrypts
ciphertext, the operation receives ciphertexts and performs operation(s) on them, the refresh operates to prevent growth of the magnitude of
noise for a
ciphertext while reducing the modulus of the
ciphertext without using the secret key, utilizing a modulus switching technique that involves transforming a first ciphertext c modulo q into a second ciphertext c′ modulo p while preserving
correctness, the technique includes scaling by p / q and
rounding, p<q; using the operation function(s), performing operation(s) on them to obtain a third ciphertext; and reducing a
noise level of the third ciphertext using the refresh function.