0
$\begingroup$

I am designing an end-to-end encrypted file storage system where only the user should be able to access their own data. The best I could come up with is a system designed around a master key that is used to encrypt the main user data. The private key is then encrypted and sent to each client using their respective public key at each device's login.

This system works in theory but it has a few flaws, the biggest being that if the master key is stolen it undermines the entire encryption. Then changing the master key to re-secure the data is impossible without re-encrypting all data, a highly inconvenient task.

My question is what should I be doing here? Does this method suffice?

Detailed Login Flow

To reiterate, this is how the setup/login flow works:

  1. Client generates new private/public key pair
  2. Client logs in using credentials and sends new public key
  3. Server decrypts master key encrypted with separate private key protected by user's password
  4. Server encrypts master key with user's public key and new returns encrypted private key
  5. Client decrypts master key and securely stores it locally

This then allows the client to decrypt all future data.

Server at rest graph Server's data Client after setup Client after setup

$\endgroup$
  • 1
    $\begingroup$ Isn't this a universal problem? Anyone with a copy of ciphertext and the key can decrypt data, no matter what the algorithm used $\endgroup$ – Future Security Jun 22 at 16:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.