Making a lock system with a 7-segment circuit
The simplest solution for actually building it (assuming you are limited to MSI CMOS logic) is probably to use a 74HC85 4-bit magnitude comparator. Inside it is more complex than your circuit, but it is only a single chip.



Of course someone doing a real design today would probably pick some other method such as a micrcontroller.