Currently I'm playing with the homomorphic library HElib and I have kind a issue with the AES implementation.
In one hand I succeed to do a simple HE encryption on plaintext and do some operation on the ciphertext. This works well. On the other hand I used the AES implematation over the HElib to cipher data and decipher it and it works well too.
Now I want to be able to use all the power of this implementation :do some HE operation on data encrypted by this AES.
On simple HE encryption the operations are made over the object Ctxt but when we use the implementation of AES all the cipher text are vector of Ctxt and I can't figure it out how I can manupilate those vector.
I took as example the Test_AES.cpp file and I use the same parameters for making the context and generate the key.(Here I'll put only the parts that I assume are important and supposing that you know a little this library, but if you need all the code I can write it)
So first I encrypt a simple vector of 1.
Vec<uint8_t> ptxt(INIT_SIZE,nBlocks*16); //Vector of 1
vector<Ctxt> doublyEncrypted;
hAES.homAESenc(doublyEncrypted,encryptedAESkey,ptxt); // Encryption of the vector store
//in doublyEncrypted
So as the library says normaly we have doublyEncrypted = Enc_HE(Enc_AES(myvector)).
Now the decryption
hAES.homeAESdec(doublyEncrypted,encryptedAESkey);
Now our doublyEncrypted is a Enc_HE(myvector). At this point I should be able to make some operation on my encrypted vector. As doublyEncrypted is a vector of Ctxt I tried something like :
for(long i=0;i<(long)doublyEncrypted.size();i++){
doublyEncrypted[i].addCtxt(doublyEncrypted[i]);
}
But when I decrypt it with the secret key and decode it all I got is a vector of 0 (I should get a vector of 2). I also tried to add a different encrypted vector but there I got a vector of some random hex value.
So my question is, is it possible with this implementation of AES over the HElib to do some operation on the cipher text and does anybody use this library enought to do such a think.
Thanks in advance!
In case anybody ever comes across this:
The poster obviously seems to have misunderstood how homomorphic encryption works. In the code example, they first encrypt a plaintext homomorphically using HElib. This ciphertext is then manipulated using the homomorphic properties into a ciphertext that represents an AES encryption of the plaintext. Adding something to this AES encryption will obviously give a meaningless result. HElib does not magically transform AES into an homomorphic cryptosystem.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With