Hmm, this is a more a cryptography question than a blockchain one. You need some way for Node A to reveal something on the chain, which all nodes in the chain can verify will allow node B to be able to open the encrypted data, but without other nodes in the chain being able to actually open the encrypted data themselves. It sounds like a zero-knowledge proof challenge.