This repo contains the code to independently recover all documents tied to your dDocs account using your back up key, in case the main dDocs app is down. Easily control your documents end-to-end without depending on centralized servers 💛
-
Clone the repository:
git clone https://github.com/fileverse/walk-away-ddocs.git
-
Install it dependencies:
npm install
Copy the .env.example file to .env in the root directory:
cp .env.example .envUpdate with config values
Start the development server:
npm run devYour portal keys consist of :
- Portal Address – The contract address that manages your files on ddocs.
- Owner Public Key - An RSA-generated public key used by the portal owner to encrypt their ddoc file data.
- Owner Private Key - An RSA-generated private key used by the portal owner to decrypt their ddoc file data.
- Portal Public Key - An RSA-generated public key used by portal collaborators to encrypt ddoc file data.
- Portal Private Key - An RSA-generated private key used by the collaborators to decrypt their ddoc file data.
- Member Public Key - An RSA-generated public key used by portal members to encrypt their ddoc file data.
- Member Private Key - An RSA-generated private key used by portal members to decrypt their ddoc file data.
Files are linked to a portal by the portal address and the fileID.
Files are encrypted using an AES key, which is generated by encrypting the file through Penumbra. This AES key is then further encrypted to create different access locks:
- Portal Lock – Created by encrypting the file key with the portal public key.
- Owner Lock – Created by encrypting the file key with the owner's encryption key.
- Link Lock - Created by encrypting the file key with a link key. Link keys are unique, randomly generated AES keys for each file, which are stored in an encrypted format using the owner’s public key. They are are used for sharing files via a link.
Files can be decrypted using any of the available locks:
- Portal Lock – Contains the encrypted file key, which is decrypted using the portal private key.
- Owner Lock – Contains the encrypted file key, which is decrypted using the owner's private key.
- Link Lock – Contains the encrypted file key, which is decrypted using the link key.
You can refer to this code for more
Comments are linked to a file by the ddoc’s portal address and ddocId.
A comment and its associated data are encrypted using a random AES key that is unique to each ddoc file. This AES key is then encrypted using the portal key, owner key, and link key to ensure secure access and controlled decryption.
A comment and its data are decrypted using the comment key, which is retrieved from the owner, portal, or link locks. The corresponding lock is decrypted using its associated key.