Skip to content
This repository has been archived by the owner on Nov 6, 2020. It is now read-only.

SecretStore: 'broadcast' decryption session #7843

Merged
merged 1 commit into from
Feb 12, 2018

Conversation

svyatonik
Copy link
Collaborator

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-bytes common_point and an array of ECIES-encrypted EC scalars (each is 145 bytes). Each entry in array is generated by one KS and there are t+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 to secretstore_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).

@svyatonik svyatonik added A0-pleasereview 🤓 Pull request needs code review. M4-core ⛓ Core client code / Rust. labels Feb 8, 2018
@5chdn 5chdn added this to the 1.10 milestone Feb 8, 2018
@debris debris added A8-looksgood 🦄 Pull request is reviewed well. and removed A0-pleasereview 🤓 Pull request needs code review. labels Feb 8, 2018
Copy link
Contributor

@5chdn 5chdn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Assuming approved by @debris :)

@5chdn 5chdn merged commit 8579a56 into master Feb 12, 2018
@5chdn 5chdn deleted the secretstore_broadcast_decryption branch February 12, 2018 17:05
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A8-looksgood 🦄 Pull request is reviewed well. M4-core ⛓ Core client code / Rust.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants