microsoft / SEAL

Microsoft SEAL is an easy-to-use and powerful homomorphic encryption library.
https://www.microsoft.com/en-us/research/group/cryptography-research/
MIT License
3.6k stars 709 forks source link

can I encrypt new data into an existing ciphertext? #703

Closed Noreaaa closed 1 month ago

Noreaaa commented 2 months ago

Hi,

I want to fully utilize the channel slots in a single ciphertext during my computation. Is it possible to have more data encrypted into a ciphertext. for example, I have a ciphertext [1, 2, 3, 4, 0, 0, ....] can I encrypt 5 into this ciphertext to make it be [1, 2, 3, 4, 5, 0, 0, ...]? I see #700 can access a single coefficient in ciphertext, so maybe it is possible?

kimlaine commented 1 month ago

Could you simply encode a vector plaintext [0, 0, 0, 0, 5, 0, 0, ...] and then do an Evaluator::add_plain or Evaluator::add?

Noreaaa commented 1 month ago

Thank you for your reply. This way is easier, I can encode and encrypt like you said. Then I want to know that the encryption key is safe to share, right?