I would like to make a secure-encrypted file sharing system. The files will be sent into an open decentralized system, so the files would be encrypted before sending it to the decentralized system.
I would like to sell the access to the files, is it possible to generate a decryption key, usable only by the person who buys the access to this file, who has a public/secret key, and we have his public one.
For example :
Let's say Alice encrypted a file F1, F2 using a decryption key D, the file F1 and F2 are then sent to a shared folder.
Bob asks Alice to decrypt the file F1, so he sends her his public key.
Alice generates a decryption key D-bob from the decryption key D, which can be used only with the secret key of Bob in order to decrypt the file F1 but can not decrypt the file F2.
Does a solution exist for this problem? I read about Shamir's Secret Sharing, but it doesn't look like it fulfills my need.