DISCLAIMER: I understand the question might be a bit amateurish due to my limited knowledge of cryptography but, please, bear with me for a minute.
QUESTION: Suppose a user Alice generates a pass phrase "hello", and a user Bob generates another pass phrase "world".
I need to create an encryption/hashing pipeline that would map Alice's pass phrase to Bob's pass phrase. I'll illustrate the basic idea of what I'm trying to achieve:
"hello" --> [encryption pipeline] -> "world"
The pipeline is unidirectional, as illustrated. The database of the server hosting the pipeline CANNOT store plain text pass phrases. It can store hashed or encrypted modifications of the pass phrases though, the basic goal is to make it impossible/immensely difficult to derive "world" without knowing that the original input is "hello" (say in a scenario where the database is compromised)
How could one securely implement such a pipeline and abide with common security principles? I've just started digging deeper into hashing/encryption algorithms, Levenshtein distance, etc. but I would really like to get an insight from someone who's a lot more knowledgeable in this area than myself.