Step 102: Obtain 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.
The computing device can belong to the target user. To be specific, the target user can perform homomorphic encryption on data m by using public key pk corresponding to the target user, to perform privacy protection for a value of data m, or perform another operation. Alternatively, the computing device can belong to a user other than the target user, and public key pk of the target user can be disclosed to the user, so that the user can perform homomorphic encryption on data m based on public key pk, and can even further perform another operation that satisfies additive homomorphism on homomorphic ciphertext c obtained through encryption, and only the target user can decrypt homomorphic ciphertext c or an operation result of homomorphic ciphertext c by using private key sk.