Possible Duplicate:
Encryption strategies for multi users access in production systems
I would like to develop a service on wich clients would connect and retrieve informations. These informations could also be shared with others.
It's very simple but, I would like to encrypt the data as only the client would have access to all his informations and the others to only what the client have granted.
In a scheme :
+----------------+ +----------------+ | SHARED DATA | |Client 1 Shared | | | ============ | Data | |----------------| |----------------| | UNSHARED DATA | | UNSHARED DATA | +----------------+ +----------------+ || || || || || || || || || || +--------+ +--------+ | Client1| | Client2| +--------+ +--------+
I was thinking of asymetrical encryption, but as I'm not familiar with that, I wanted to know, how could I store keys for that (the client is an eyeball, he have only a password, he can't be uploading/retrieving keys).
Multiples problems/questions coming : If I encrypt the keys with his password. He loses all his informations...
Should I use a private key to encrypt the data wich will be shared, (if someone get a public key, he would be able to access, maybe a handshake or something could counter that) ? Or a public key given by the second service ? In that case, the service n°1 have to be able to read the data to encrypt it...
If I encrypt the data any time something has to be shared, I will lose efficiency, don't I ?
I really don't know how to proceed. My goal is to protect most of the user-data. What do you suggest ?
Thanks in advance.