Assume that there is a cyphertext that I want to make such that only someone who can prove ownership of a certain public key, or set of public keys would be able to decrypt.
It is my understanding that theoretically, this is solved by witness encryption.
Is there currently any implementation of such an algorithm in the wild? If yes, is there anything actually practical?
Edit:
I realized that my question is not very clear. My goal is not only to let only someone with a particular private key decipher the encrypted data, which is just trivial encryption. Rather, I want to make it so that only someone who can prove that they have a solution to a problem (in this case, the problem would be, proving that a particular public key owns some object) can decrypt it.
Example: I want to create an open source game public key based game where secrets are spread throughout the world. The secrets are encrypted files. Only players who own a certain item (a key to a treasure for example) may decipher them. So they would need to solve the problem of "proving that I own the key", which would be done by signing a message with their private key showing that they have the required item.
I hope this makes the question clearer.