homenc / HElib

HElib is an open-source software library that implements homomorphic encryption. It supports the BGV scheme with bootstrapping and the Approximate Number CKKS scheme. HElib also includes optimizations for efficient homomorphic evaluation, focusing on effective use of ciphertext packing techniques and on the Gentry-Halevi-Smart optimizations.
https://homenc.github.io/HElib
Other
3.11k stars 760 forks source link

How can I set my own key #433

Closed KwonDK closed 3 years ago

KwonDK commented 3 years ago

Hello, I want to set my own secret key, but the function GenSecKey() cannot provide this.

For example, I try to set my secret key like [1,0,1,0] according to BGV (context : p=17, r=1, m=8).

helib::Context context = helib::ContextBuilder<helib::BGV>() .m(m) .p(p) .r(r) .bits(bits) .c(c) .build() helib::SecKey secret_key(context); secret_key.GenSecKey();

I cannot input secret key [1,0,1,0] anywhere..

Does HElib support a secret key customizing?(like password) Is there any function that can provide a 'custom secret key'?

faberga commented 3 years ago

@KwonDK In HElib we don't support an API to customize keys like passwords. Key pairs are genearated based on the context parameters. Each key generation request generates a new key.

Please check the utilities provided in the utils directory.

KwonDK commented 3 years ago

@faberga Thank you very much!