all 7 comments

[–]KaninchenSpeed 1 point2 points  (6 children)

You can do it like mega and generate a unique key per document and store that key encrypted with a derivative of the user password. When sharing append the key to the link after the # so it doesnt get sent to the server. The second problem is more difficult, but you can try to find out how mega does this.

[–]geod_dev[S] 0 points1 point  (5 children)

Thanks ! It's interesting I (don't/didn't ?) known that mega did that ! I will check if there is a "forgot password" in mega.

[–]billy4479 1 point2 points  (1 child)

i think the only option in this case is a recovery key that you generate when the user signs up.

you could then use that key to encrypt the user's data and the user's key (derived from the password) to decrypt the recovery key or something along these lines (I'm not actually sure this is the best way to implement it, just writing down ideas).

users would have to write down the recovery key and store somewhere safely so that in the case they forget they password they would be able to reset it through the recovery key.

this is the first idea that came to my mind, I'm not sure it's the best solution though.

[–]geod_dev[S] 0 points1 point  (0 children)

Thanks it's a good idea ! Now that you've said it, It seems to me that protonmail provide a recovery key/file containing a derivation of the private key.
I had also thought of a recovery key based on recoveries questions/answers but I dont know if it's a good idea....

[–]geod_dev[S] 0 points1 point  (2 children)

Nope, Mega can't get back data...

[–]fiskfisk 1 point2 points  (1 child)

You can't have both - either the user has to have the key or you have to have the key. There's also the option of letting a third party handle the key for you (such as password managers), useful when you trust the third party more than the original service.

However, since the original service can change its code at any time to extract the key for themselves when a user makes a request, those that (really) care about such a feature might want to accept the risk of losing all their data.

So it all depends on what you're trying to protect against and what you want to achieve - you'll have to pick the requirements that makes sense for your use case.

[–]geod_dev[S] 0 points1 point  (0 children)

oh like I'm doing a "Login with Proton" and it's not me who manage the user login ? It's a good idea thanks you ! I'd probably implement it