Design a multiplication homomorphic encryption scheme.

cuiguoxing2008 注册会员
2023-02-25 23:33

the reference answer GPT ᴼ ᴾ ᴱ ᴺ ᴬ ᴵ < br / > multiplicative homomorphic yption scheme can be through the use of certain mathematical operation technology, converting plaintext multiplication operation in the cipher text addition operation. This scheme can perform multiplication without exposing any encrypted information.

The following is a simple multiplicative homomorphic encryption scheme:

  1. Choose two large prime numbers p and q, and calculate n = p * q, as the public key.

  2. Select a number g, satisfying that g is the original root of n, as the public key.

  3. Select an integer a at random and compute g to the a-modulo n as the private key.

  4. Encrypted plaintext x: Select a random number r and calculate y = g^x * r^n mod n, where y is ciphertext.

  5. Encrypted plaintext y: Select a random number s and calculate z = g^y * s^n mod n, where z is ciphertext.

  6. Calculate the product: Calculate w = y * z mod n, where w is the ciphertext of a*b.

  7. Decrypt: Decrypt w as plain text w', calculate w' = w^(1/a) mod n, where a is the private key.

can prove that this scheme can implement multiplicative homomorphic encryption, that is, for ciphertext y and z, the decrypted plaintext is y' and z', Y '* z =(g ^ * r ^ n) x ^ ab * ^ ^ ^ y * s n(g) ab mod n =(g ^(abx + aby) * r ^(abn) * s ^(abn) mod n = g ^(abx + aby) *(r ^ n) ^ ab *(s^n)^ab mod n = g^ab(x+y) * y * z mod n = a*b

The main advantage of this scheme is that it is easy to use and can implement multiplicative homomorphic encryption. The disadvantage is that the security is not high enough, and the private key can be solved by attack. In practice, more complex schemes are needed to improve security.

dengwei99 注册会员
2023-02-25 23:33

Part of this answer references GPT, GPT_Pro better solution
Multiplication homophase yption scheme is an encryption technique that computs multiplication without providing a secret key. The basic principle is to use a special function to convert plain text to ciphertext, and the conversion process does not change the result of multiplication.

Specifically, the flow of the scheme is as follows:

  1. Given plaintext a and b, calculate their product ab.
  2. First, using the specific encryption functions E(a) and E(b), encrypt a and b into E(a) and E(b), respectively.
  3. Using another specific multiplication function M(E(a),E(b)), multiply the two encrypted numbers together to give an encrypted multiplication result M(E(a),E(b)).
  4. Compare this result to the product ab of the original plaintext ab. If it is the same, then the encryption is correct.

This way, multiplication can be done safely without revealing the original information.

The scheme has sample code on github for reference, and can be used to implement various system security functions. For example, this scheme is used for information transmission: when the client sends the information, the information is encrypted with the multiplication homomorphic encryption function; The server then decrypts the plaintext using the same function; Finally, the server returns the plaintext to the client. This ensures that the information is not intercepted or stolen by others in the process of transmission.

In a word, multiplicative homomorphic encryption scheme is a very easy to implement and very secure encryption method, can be used in a variety of different fields, effectively ensure the safe transmission of important information.
If the answer is helpful, please accept it.

About the Author

Question Info

Publish Time
2023-02-25 23:33
Update Time
2023-02-25 23:33

Related Question


Ant Design Vue表格

盒子模糊练习| CodeSignal


Ant Design Vue库中的树选择组件无法自定义后缀图标

touch designer 快捷键无法使用