I've found a few questions which address a single document that needs decryption by multiple users, but I would like to encrypt a list of words stored on mySQL datbases using PhP in such a way that different users can decrypt different words on the list.

I'm wondering whether there's a way for collaborators who have a lot of words that they want encrypted to do it without having an insane number of keys. For example, let's say we have Andrew, David and Sam, who all have public keys stored on the server, and each have a private key that is encrypted using their password. Now Andrew wants to share a list of groceries with David so that Sam can't read it. What seems secure is for Andrew to generate a symmetric key to encrypt the whole list, and then encrypt this symmetric key using his and David's public key so that they can then decrypt the symmetric key using their private keys.

However, what if the grocery list is going to frequently have items added to it? My understanding is that using the same symmetric key to encrypt all the items individually in the list is not safe (e.g. encrypting the words "apple" and "orange" separately with a single synchronous key). Does that mean a unique synchronous key is required for each item?

As the items would be stored as separate entry in a mysql database, I think I would need to encrypt each item individually, rather than merge them into a single list and then encrypt.

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.