I came accross a privacy and cofidentiality problem in medical field where patients medical record is available to certain doctors in full, but researchers/pharmacutical companies can only view the test reports but not the identity of the patient like name and social security number etc.

I know this can be implemented by some programming checks in application, but how to achieve this functionality using cryptography? Where an encrypted record is partially decryptable by one party but fully decryptable by other.

Any guidance/reference to already published or in use scheme will be helpful.


1 Answer 1


This kind of thing would typically be done via role based accessed control (RBAC), not encryption. To do something like this strictly with encryption if you could assign identities upfront then you could use hybrid encryption to achieve this (though it seems a bit clumsy). A public/private key pair is assigned to each role. Data is encrypted with a randomly generated symmetric key and that key is then encrypted with the private key of the role(s) that access the data. Each user has a role and therefore a set of public keys associated with that role. If the user has a public key that can decrypt the symmetric key they can then decrypt the data and view it.

RBAC is a better solution.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.