In view of this, one or more implementations of the present specification provide a homomorphic data encryption/decryption method and apparatus for implementing privacy protection.
To achieve the previous objective, the one or more implementations of the present specification provide the following technical solutions:
According to a first aspect of the one or more implementations of the present specification, a homomorphic data encryption method for implementing privacy protection is provided, and includes the following: obtaining public key pk={N, h} corresponding to a target user, where h is a generator of a predetermined cyclic group with a size of k in random number space Z*N, a length of k is i bits, a length of N is n bits, and i<<n; selecting random number r, so that hr belongs to the predetermined cyclic group; processing to-be-encrypted data m corresponding to the target user by using public key pk and random number r, to generate homomorphic ciphertext c=(1+N)m·(hr mod N)N=(1+N)m·(hN mod N2)r mod N2; and providing homomorphic ciphertext c to the target user, where homomorphic ciphertext c can be decrypted by the target user by using private key sk to obtain data m, a value of private key sk is α=a·k, and a is a predetermined non-zero value.