blockades / scuttle-dark-crystal

API for validating, building, publishing and reading Dark Crystal records
http://darkcrystal.pw
MIT License
42 stars 2 forks source link

Ephemeral shard returns #47

Closed m4gpi closed 5 years ago

m4gpi commented 5 years ago

To improve security we want to use a system of ephemeral keypairs for shard returns so that previously returned shards (and therefore secrets) cannot be obtained in the case of SSB identity being compromised.

The need for this is explained in our report 'Security Considerations for Shamir's Secret Sharing' and discussed in this SSB Thread: %2qEtYbJ/tAiFuXHYgdfou7BvERxtIF7Cdq3NmjkSF4w=.sha256

We have developed an Sbot plugin for this and begun work to implement it at the API level. However we have uncovered several issues which makes this quite a lot more difficult than expected:

# recover.async.recombine (request v2 shards): Returns the recombined secret 
Key in: {"rootId":"%xNecYPfSM2HBeGsmODV5P9O5C1j3u0HiS1dyyOYr/Tc=.sha256","recp":"@Y7BwStaveqgS2JNYfPmSwYzr5k1PwzVzd7LkMZBXtr0=.ed25519"} 
Key in: {"rootId":"%xNecYPfSM2HBeGsmODV5P9O5C1j3u0HiS1dyyOYr/Tc=.sha256","recp":"@wPbCDZltMC+YpbcHRerXcxSLNh2iqqYLx7Bx8nIgvUI=.ed25519"} 
Key in: {"rootId":"%xNecYPfSM2HBeGsmODV5P9O5C1j3u0HiS1dyyOYr/Tc=.sha256","recp":"@0c/+LuvweMuD/PVAIImAvjHyMWKcI1qOv/Id7CsebtQ=.ed25519"} 
/home/beetroot/software/scuttle-dark-crystal/recover/async/mend.js:16
if (!shards.length) return cb(new Error('no valid shards provided to mend'))

TypeError: Cannot read property 'length' of undefined
gitcoinbot commented 5 years ago

Issue Status: 1. Open 2. Started 3. Submitted 4. Done


This issue now has a funding of 1000.0 DAI (1000.0 USD @ $1.0/DAI) attached to it as part of the Ethereum Foundation fund.

gitcoinbot commented 5 years ago

Issue Status: 1. Open 2. Started 3. Submitted 4. Done


Work has been started.

These users each claimed they can complete the work by 2 weeks, 4 days ago. Please review their action plans below:

1) ameba23 has been approved to start work.

Learn more on the Gitcoin Issue Details page.

2) ashd32 has applied to start work _(Funders only: approve worker | reject worker)_.

I will use next generation ECMAscript to modulate this task. Once refactored, it will be simpler to achieve your goal and resolve this issue.

Learn more on the Gitcoin Issue Details page.

gitcoinbot commented 5 years ago

@ameba23 Hello from Gitcoin Core - are you still working on this issue? Please submit a WIP PR or comment back within the next 3 days or you will be removed from this ticket and it will be returned to an ‘Open’ status. Please let us know if you have questions!

Funders only: Snooze warnings for 1 day | 3 days | 5 days | 10 days | 100 days

ameba23 commented 5 years ago

i've started on this in the two referenced PRs.

gitcoinbot commented 5 years ago

@ameba23 Hello from Gitcoin Core - are you still working on this issue? Please submit a WIP PR or comment back within the next 3 days or you will be removed from this ticket and it will be returned to an ‘Open’ status. Please let us know if you have questions!

Funders only: Snooze warnings for 1 day | 3 days | 5 days | 10 days | 100 days

ameba23 commented 5 years ago

still working on the two referenced PRs

gitcoinbot commented 5 years ago

@ameba23 Hello from Gitcoin Core - are you still working on this issue? Please submit a WIP PR or comment back within the next 3 days or you will be removed from this ticket and it will be returned to an ‘Open’ status. Please let us know if you have questions!

Funders only: Snooze warnings for 1 day | 3 days | 5 days | 10 days | 100 days

ameba23 commented 5 years ago

Work is completed.

[x] Define tests which take account of ephemeral keys stored on disk for different users For example see this test [x] Write method for deleting the keys when they are no longer needed See recover.async.deleteKeyPair and recover.async.deleteKeyPairs [x] Define an appropriate 'context message' to improve security Context messege now contains the rootId as well as the feedId of the custodian. [x] Use objects as database keys for storing the ephemeral keys Database keys are 'stringified' objects containing the same information as the context message. [x] Fix bugs with unrecognised keys All tests now passing.

What remains is some design issues around versioning of the 'request' and 'reply' messages. I have implemented this in an opinionated way, maybe not everyone agrees on it.

gitcoinbot commented 5 years ago

Issue Status: 1. Open 2. Started 3. Submitted 4. Done


Work for 1000.0 DAI (1000.0 USD @ $1.0/DAI) has been submitted by:

  1. @ameba23

@ceresstation please take a look at the submitted work:


gitcoinbot commented 5 years ago

Issue Status: 1. Open 2. Started 3. Submitted 4. Done


The funding of 1000.0 DAI (1000.0 USD @ $1.0/DAI) attached to this issue has been approved & issued to @ameba23.