A homomorphic cyclic operation method performing a homomorphic cyclic operation on a periodic array of data using homomorphic encryption having a homomorphic operation defined with respect to at least one multiplication wherein a periodic array is formed by selecting rows corresponding to a periodic data from a score table indicating the similarity relationships between each element of the periodic data and connecting the rows into a single line, the homomorphic cyclic operation method comprising:
- encrypting the periodic array of data by storing the periodic array in the coefficients of an indeterminate polynomial to generate a ciphertext of periodic data;
- shifting the periodic array of data in the ciphertext of the periodic data by multiplying the indeterminate raised to the power of a shift amount to the ciphertext of the periodic data;
- and
- calculating similarity between the periodic data and a comparison periodic data by performing an inner product operation between the ciphertext of the periodic array and the ciphertext of the comparison array which assigns 1 to matching positions and 0 to non-matching positions based on elements contained in a comparison periodic data.