Crack the code to the combination lock
CJam, 9 8 bytes

ea9fbAf%


Reads the digit pairs as command-line arguments. To try the code online, change ea to lS/ to read from simulated STDIN.

Example run

$ cjam &lt;(echo ea9fbAf%) 57 23 99 45; echo
2101
$ cjam &lt;(echo ea9fbAf%) 25 78 63 15; echo
3174


How it works

The character code of the digit d is 48 + d. Thus, considering the two-digit string xy a base 9 number yields 9 * (48 + x) + (48 + y) = 10 * (48 + x) + y - x ≡ y - x (mod 10).

ea       " Push the array of command-line arguments.                                      ";
  9fb    " Mapped base 9 conversion; replace each string 'xy' with (9 * ord(x) + ord(y)). ";
     Af% " Take the results modulo 10.                                                    ";