How to share the user profiles with other users?
You could use the custom field value as a Contextual Filter and hence only show results to B for contacts where the other contacts' custom field matches that of B. I am not quite clear on how to do this but getting the value from B and applying it as a filter on the view seems like it should be entirely feasible.

Alternatively could you consider basing this on Relationships between B and A.