Start with “Shamir's Secret Sharing” concepts…
Abstract. In this paper we show how to divide data D into n pieces in such a way that D is easily reconstructable from any k pieces, but even complete knowledge of k - 1 pieces reveals absolutely no information about D. This technique enables the construction of robust key management schemes for cryptographic systems that can function securely and reliably even when misfortunes destroy half the pieces and security breaches expose all but one of the remaining pieces.
source: http://dl.acm.org
In a nutshell:
I have a secret $S$. Let's say $S=10$ (or a password turned into the value $10$), and I want to share it between $N=2$ people. I create a polynomial of degree $d=N-1$ (because I care to have a secret for two people):
$$f(x) = ax + b$$
We set $b = S$, and let $a$ be a random value larger than $S$ and $N$. For example, let's say $a=13$.
Therefore:
$$ f(1) = 13*1+10 = 23
\\ f(2) = 13*2+10 = 36
$$
Now, send $f(1)$ to person $1$, and $f(2)$ to person $2$. In order to obtain the secret $S$ and to unlock the door, both person $1$'s value and person $2$'s value are needed.
Using polynomial approximation, we can get the resulting $f(x)$ from the people values:
$$ f(x) = \sum_{i=1}^N f(i) \cdot
\prod_{j\neq i} \frac{x-x_j}{x_i-x_j}
= \sum_{i=1}^N f(i) \cdot
\prod_{j\neq i} \frac{x-j}{i-j}
$$