Abstract:
An apparatus of this invention is directed to a ciphertext generation apparatus that can compare the magnitudes of encrypted numerical values and largely reduce the risk of information leakage while maintaining the confidentiality. This ciphertext generation apparatus includes a derived key generator that generates a derived key based on a main key and a document, an auxiliary derived key generator that generates an auxiliary derived key based on the main key, the document, and the derived key, an identifier-specific ciphertext generator that generates, based on an identifier of the document, the derived key, and the auxiliary derived key, an identifier-specific ciphertext in which the identifier is encrypted, and a relative value ciphertext generator that generates, based on the identifier and the derived key, a relative value ciphertext in which a relative value generated from the main key, the document, and the derived key is encrypted. A character string including the identifier-specific ciphertext and the relative value ciphertext is generated as a ciphertext for the document.