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

Partially homomorphic encryption for server-side conflict resolution #29

Open
michwill opened this issue Feb 15, 2016 · 1 comment
Open

Comments

@michwill
Copy link
Contributor

Currently, when two clients save the same object at the same time, we get a ConflictError. When we work with plain, unencrypted database, it is possible to do server-side conflict resolution in ZODB. However, when we encrypt objects before they leave the client, we don't have that luxury.

It appears that most of ConflictErrors should happen at BTrees.Length.Length objects though. And for those, we can use additively homomorphic encryption (Pailier cryptosystem or, better, exponential ElGamal).

Two ways possible:

  1. Store (enc(+value), enc(-value)). In a conflict, newval = (val1 + val2 - val, -val1 - val2 + val)
  2. Store enc(newvalue) and have enc(newvalue - oldvalue) (not stored) as a temporary delta to add when a conflict occurs.

Variant 1 is cleaner, easier to implement and more ZODB-compatible but uses more space. In terms of size, 2048 bit ElGamal would yield 1KB in the first case or 0.5 KB in the second. Since we use Length objects not too often (numbers of items in datasets and numbers of documents for a given keyword) solution (1) shouldn't be problematic.

@michwill
Copy link
Contributor Author

michwill commented Aug 4, 2016

This is a low-priority nice-to-have, first we need client side conflict resolution

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

No branches or pull requests

1 participant