Cryptrees
Schema for encrypting filetrees such that if you have access to a directory, you have access to every file underneath it.
Take this file structure with directories A, B, and C and files f1, f2, f3
A
/ \
B C
/ / \
f1 f2 f3
- Directory A is encrypted with symmetric key kA
- Directory B is encrypted with kB = hash(kA, “B”)
- Directory C is encrypted with kC = hash(kA, “C”)
- File f1 is encrypted with kf1 = hash(kB, “f1”)
- File f2 is encrypted with kf2 = hash(kC, “f2”)
- File f3 is encrypted with kf3 = hash(kC, “f3”)
Since hashes are one-way functions, you can:
- derive {kB, kC, kf1, kf2, kf3} by knowing kA
- derive {kf2, kf3} by knowing kC
- derive no other keys by knowing kf3
In other words: knowing a key gives you access to every child dir & file without giving any information about the parents.
Paper on the subject:
https://ieeexplore.ieee.org/document/4032481
Peergos, where I first came across the idea and pretty similar in some ways to what we’re doing:
https://peergos.org/
Torus
Discourse doesn’t want me to make more than 3 consecutive replies so editing here
Spent awhile investigating Torus. Very interesting idea: key management through some type of OAuth social service (Google, Github, Twitter, etc).
After some research, I don’t think this is going to work out as one of our initial identity offerings.
Decentralization concerns
Found it pretty difficult to determine what exactly was happening under the hood.
My best read is that it’s a permissioned network of nodes that hold shards of your key. There are “incentive structures” (staking where if you commit fraud, your stake gets slashed) in place to prevent them from leaking shards or colluding to reconstruct your privkey. OAuth is just used as a method for you to display to a node in the network that you are who you say you are.
I’m uncomfortable with this setup because it’s not terribly decentralized. It seems very easy for nodes to collude, and reconstruct your privkey. I’m not convinced that the incentive structures are any stronger than just trusting your privkey with a centralized entity.
Also this scheme is only as secure as OAuth is. So if your token leaks, your screwed. And if the OAuth provider turns out to be a bad actor, they can capture the private keys of everyone using their service.
I might have some of this wrong, as I said, I had a pretty hard time gathering info from their documentation. As Brooke suggested, I’m planning on reaching out to them to get some clarity.
Can’t get privkey from web3 wallet
This is the big clincher. They act as a provider that you pass to an instance of web3.js, similar to Metamask. For security reasons, you can’t just get the privkey out of web3. So Torus won’t work at all for us in the beginning when we’re more concerned about privkey encryption than we are about eth txs. This would really only come in down the line as a key recovery option