This repository has been archived by the owner on Nov 6, 2020. It is now read-only.
SecretStore: 'broadcast' decryption session #7843
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is a (one of) preliminary PR for adding encryption/decryption support to SS service contract. Besides checking this PR, please try to read && criticize my approach.
So there exists Document key shadow retrieval session, which is currently used to read document key without reconstructing it on any Key Server. When used via HTTP API, it returns three items: 64-bytes
decrypted_secret
, 64-bytescommon_point
and an array of ECIES-encrypted EC scalars (each is 145 bytes). Each entry in array is generated by one KS and there aret+1
entries, where t is the key threshold.Previously this session had only gathered all required data on single key server (the one which was asked to restore the document key). In service contract PR there's another approach - we need to confirm decryption by every participating key server. So this PR is about this - in special mode (when
is_broadcast_session == true
) all data is broadcasted by every KS && at the end of session it is known by every consensus group node.Life after this PR: the idea is that every KS will call a service contract method, which in turn will raise a big event like this:
event RestoredByKeyServer(bytes32 keyId, uint threshold, 64-bytes blob, 64-bytes blob, 145-bytes blob);
. Yet the number of events could also be huge (if we're dealing with a big SecretStore and key threshold is big). The requester should wait for enough events and pass events data tosecretstore_shadowDecrypt
.So the question is - do you think if this approach (described in previous section) is viable, or not? If not, we can now start with Document key retrieval session which is not as secure, as previous (document key will be restored on one of key servers before encrypting and publishing via log events). And later try to find a way to generate less spam (maybe will finally find a way to use commutative encryption in SS).