ssbc / private-group-spec

GNU Lesser General Public License v3.0
13 stars 1 forks source link

Where do we get `own_key` from? #29

Open Powersource opened 1 year ago

Powersource commented 1 year ago

https://github.com/ssbc/private-group-spec/tree/master/direct-messages#b-self-case---mapping-our-own-feed_id-to-recp_key

That section just says

Instead, when you see your own feed_id as a recipient, you're expected to map that to a private symmetric key, own_key.

how do you do that mapping? @staltz said that he adjusted box2 so that own_key should be recoverable from the recovery string (used in mv) but how?

staltz commented 1 year ago

Here is the encryption mapping: https://github.com/ssbc/ssb-box2/blob/2660ced84f75129a5011f5bb44776ae2afffec19/format.js#L185-L186

And here is the decryption (no mapping needed because we just try all the keys): https://github.com/ssbc/ssb-box2/blob/2660ced84f75129a5011f5bb44776ae2afffec19/format.js#L265

Then we just need to call box2.setOwnDMKey where the input is derived from your secret, but that's not done in Manyverse yet.

Powersource commented 1 year ago

Then we just need to call box2.setOwnDMKey where the input is derived from your secret,

I guess my question is maybe how would this exactly be derived?

staltz commented 1 year ago

Good question. I am sure I gave this topic a thought in the past, but can't remember at all what the derivation would look like...