ConsenSysMesh / web3studio-sojourn

A React Native DevKit with code for a Web3 Decentralized Data Storage Pattern.
https://consensys.github.io/web3studio-sojourn/
Apache License 2.0
31 stars 5 forks source link

Security design #15

Closed hadasz closed 5 years ago

hadasz commented 5 years ago

As a user, I want to know it is extremely hard for someone to get to my stuff.

If file is all in one place, a malicious actor could potentially figure out how to decrypt it.

humbitious commented 5 years ago

...so that I can store my docs somewhere in case I lose my phone but not worry about someone getting that "cloud" file and decrypting.

hadasz commented 5 years ago

Design - each file gets encrypted with AES, via a private key generated by Sojourn that also has a corresponding mnemonic. Output of AES is a byte array. Byte array is interpreted as integer and encrypted with Shamir's Secret Sharing Algorithm, which outputs a number of shards. We take each shard, and put it into a hash function, along with the private key to produce a new shard. all shards are needed to reconstruct the AES encryption. Each shard is put into a different place in IPFS. IPFS array is stored in Azure, and secured by Ethereum private key. New phones can be added via uPort for Ethereum wallet and mnemonic for Sojourn generated key.