zeutro / openabe

The OpenABE library - open source cryptographic library with attribute-based encryption implementations in C/C++
http://www.zeutro.com
GNU Affero General Public License v3.0
262 stars 71 forks source link

open ABE encrypted on windows cant be decrypted on linux #55

Open nguyenquangtrung opened 3 years ago

nguyenquangtrung commented 3 years ago

Hi,

I'm using OpenABE for a project When I encrypted openabe on the windown and send to encrypted text to linux with same key but not decrypted I don't know if openabe supports this kind of thing?

PekeDevil commented 3 years ago

For decryption, you need to specify a ciphertext, a secret key, and some public parameters, let's call them PK. Public parameters are not exchangeable. I don't think this is an issue of Linux VS windows, but of incompatible PK. If you have a secret key generated in system A, it has been generated according to a PKa, and you may also have generated some ciphertexts related to that system (let's call them CTa).

If you are generating a second system in your windows machine (let's call it system B), you may also have generated PKb, so you will not be able to decrypt things coming from system A. Instead, you need to send the ciphertext and the public parameters, and the user needs to use the corresponding secret key.

Summarizing:

CTa requires PKa and SKa to be decrypted. CTb requires PKb and SKb to be decrypted.

A user may hold both SKa and SKb, but then they must know when to pick which one to use and the associated PK.

Hope this helps, since I see this issue is quite old. If not, I hope it helps some future user.