I am working on an app that has to transfer sensitive data over HTTPS and I have an idea but I am wondering if it is overkill or good.

One of the issues is I need the ability to "share data" between users, so I created the idea of a group.

Each user has a secret key which is stored in their browser (if they want or they can type it out everytime they want to get the data). Each users secret key is immediately encrypted upon entering it using the "code" from the server.

Each user has a "code" which is stored on the server. This is generated on registration. This is used to encrypt the secret key stored in the browser.

Each user can be part of a group, each group has a 256 bit key which is generated on created. All of the groups sensitive data are not encrypted with the users secret key, but the groups key. The each group member has the same key that’s encrypted with that users secret key. So to request group data it sends the users encrypted key to the server, the server sends back the encrypted data (encrypted with the group key AND the encrypted group key) the browser then decrypts the content by using the secret word in the browser to decrypt the group key and then uses the group key to decrypt the data.

Reasoning for all of this.

  1. I want to make sure if the "evil person" has 2 pieces of the puzzle they are still not able to access the data. Say the "evil person" steals the users laptop which has the secret word, and possible data sent. I want to make sure they would still need to login in order to decrypt the data (to get the code which is used to decrypt the secret word). (Maybe this is excessive?)

  2. The rest is just standard encryption stuff. With the addition of the ability to share encrypted stuff among multiple users.


  • Have you looked at existing secure message protocols? Always better to use an existing (ie: tested) system over home grown Jun 24, 2016 at 4:36

1 Answer 1


Ever heard of RSA? Much more safe and much more simple. Every client generates an private key and sends its public key to the server. The client that starts a group generates an AES key for encrypting group files and decrypts the key with each public key of the other members. Than it sends the encrypted keys to the other members. They use their private key to open the group key. Now they all now the group secret and can exchange data secretly. 100% secure and simpler as it sounds

  • How would a user regenerate their private key, if say they went on a different computer? I can't store the private key on the server. I believe my method would be similar to how 1Password (support.1password.com/secure-by-design) and other work.
    – Steven
    Jun 23, 2016 at 21:57
  • @Steven you could use a user inputted password to seed a random number generator used for the key creation. That could then be replicated Jun 24, 2016 at 4:33
  • How do you send your group key to the users? Encrypted with the users key? Than your key needs to be shared with other persons. So you need to generate a key for every communication with the Diffie Hellmann Algorithm. So you must store a lot of credentials instead of one. In my Case you just need to store the users key (can be encrypted with users password and send to server) and the group keys. Thats much more simple Jun 24, 2016 at 10:43
  • @Jonasw thanks, I am looking into your method and trying to figure out the group part in terms of server & browser. So I have the user generating a RSA key pair in their browser and keeping the private key in the browser and then send the public key to the server. Now if they create a "group" it generates an AES key in the browser that is used to encrypt the data? I must be missing something from your post, cause the AES key would need to be shared to the members or something, but it needs to be encrypted when it's shared and allow for more members to be added?
    – Steven
    Jun 24, 2016 at 14:27
  • Yes one user generates an AES key. To share it with the other members the user needs the public key of the others. In fact you could make this completely without the server excepting a public key - username database Jun 24, 2016 at 14:31

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .