Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to shuffle ciphertexts? #79

Open
lzjluzijie opened this issue Apr 9, 2024 · 6 comments
Open

How to shuffle ciphertexts? #79

lzjluzijie opened this issue Apr 9, 2024 · 6 comments

Comments

@lzjluzijie
Copy link

Hi, I am new to homomorphic encryption. I didn't find how to shuffle ciphertexts in this library. Is there any way to do it? Thank you.

@justalittlenoob
Copy link
Contributor

Hi @lzjluzijie
This library does not have shuffle functionality. If you want to improve ciphertext security, how about using this ?

void applyObfuscator(std::vector<BigNumber>& ciphertext) const;

@lzjluzijie
Copy link
Author

What exactly is this function doing? My current use case is that Alice holds the private key and an array of ciphertext, sent the ciphertext of the array to Bob. Bob adds the an array of data to the ciphertext, shuffles the result ciphertext, and send back to Alice. So Alice and decrypt the results, but don't know what Bob's array is, since the order is changed.

@justalittlenoob
Copy link
Contributor

In your usage scenario, the result returned by Bob cannot be decrypted. As you said, the order is changed.
This library can adapt to this scenario:

  • Alice: has pk & sk, an array A. CT_A = pk.encrypt(A)
  • Bob: get pk & CT_A from Alice, has an array B. CT_B = pk.encrypt(B)
  • Bob: CT_RES = CT_A + CT_B
  • Bob: send CT_RES to Alice.
  • Alice: RES = sk.decrypt(CT_RES).

@lzjluzijie
Copy link
Author

Sorry I didn't explain my needs clearly. The steps you mentioned is exactly want I am doing now. However, I don't want Alice to decrypt the RES like this directly, since Alice would learn the values of B by RES-A. If Bob can shuffle CT_RES to CT_RES', Alice can still decrypt the same results RES', a permutation of RES, but in a different order, so Alice cannot compute B directly since RES'-A is meaningless.

@justalittlenoob
Copy link
Contributor

Okay, I think I got your point. This library doesn't provide any related functions (shuffle), so you can only implement it yourself.

@lzjluzijie
Copy link
Author

I see. Can you give me any hint about how to get started?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants