The invention discloses a method and a
system for sequencing ciphertexts orienting to
homomorphic encryption. The
system comprises the following three parties: a
client side, a storage
server and an agency, wherein the storage
server and the agency cannot mutually collude. The method comprises the following steps: an SH. Keygen secret
key generation operation is adopted by the
client side to generate a pk (public key) and a sk (secret key); the sk is sent to an agency
server by the
client side; data are encrypted, and are mandated to the storage server by the
client side; a sequencing command is sent to the storage server by the
client side; homomorphic subtraction operation is carried out on the ciphertexts need to be ranked by the storage server, so as to obtain the
ciphertext csub which is equal to SH. Sub (pk, c1, c2); the
ciphertext csub is sent to the agency server; the
ciphertext csub is decrypted through the agency server by utilizing the sk, so as to obtain a
plaintext sub which is equal to SH. Dec (sk, csub); the sub is compared with 0 to determine the sequence of the
plaintext; the result is encrypted to be sent to the
client side through the storage server; and after the result is decrypted through the client side, so as to obtain the sequence of the
plaintext corresponding to the ciphertext, no plaintexts are leaked in the whole process; although the difference of the plaintexts is obtained through the agency server, the plaintexts corresponding to the difference cannot be calculated; and the whole process is safe.