Let's say I want to build a public repository of encrypted files.
And I have users with Public/Private key pairs.
Now I want to give individual users permanent access to individual files by handing them some special
MagicKey that is only for them.
However, I don't want them to be able to share
FilaA with third parties except by sharing
FileA directly (or by also sharing their private key).
decrypt(PubX, MagicKey(PubX, EncAPars), EncA(FileA)) yields FileA, but with no intermediate result that can directly decrypt
A close solution I was thinking about is:
EncA(FileA) = aesEncrypt(aesKeyA, FileA) MagicKey(PubX, aesKeyA) = rsaEncrypt(PubX, aesKeyA) decrypt(PrivX, MagicKey(PubX, aesKeyA), Enc(FileA)) = aesDecrypt(rsaDecrypt(PrivX, MagicKey(PubX, aesKeyA)), EncA(FileA))
but this does not do what I want, because
UserX could just share the AES key with third parties who download
EncA(FileA) from my repository and then decrypt directly.