Hello engineers first off I have not seen anything like this so if I have accidentally ripped someone's idea I apologize and I'll be sure to give credit where credit is due. What I have built is a Mechanism that can use any block/item* as a key, let me explain. Say you want to build a door that will only open with a green wool block, this machine can do that. Say you want the door to only open with a jungle sapling, this machine can do that. Any block/item you want as the lock and key this machine can handle it, you get the picture. This machine also offers the owner the chance to change the lock/key on the fly if he/she feels that the key's secret identity has been compromised.
What's the physics behind this? This mechanism works by taking advantage of an interesting characteristic with items. When items are thrown on the ground they will "stick" to each other becoming a larger pile. Using this characteristic the machine can distinguish between one item from another and only allow the correct item. From my testings this machine is very accurate when distinguishing between correct and incorrect keys.
*Excluding arrows, eggs, snowballs, fire charges, armor, and tools*
Sorry about the picture, it is not a very good angle. The left dispenser is where you would place your "key" and the right dispenser is where you'd put the "lock". When you insert your key and press the button both dispensers will fire there contents. the "lock" dispenser's item will land on ice, and the "key" dispenser's item will land in water. The "key" will then slide next to the "lock" item. If the "key" and "lock" items are the same they will stick together and the door will open. If the "key" differs from the "lock" then the "key" will slide by and land on the pressure plate which will eventually lock the output repeater to an off state.
The input is a button located in the bottom left, and the output is located on the top right.
How To Build
be sure that no other blocks touch the fence post
I hope my description helps, if you have any questions, comments, or constructive criticism please feel free to tell me.
The Meaning of Life, the Universe, and Everything.
Sarc came up with a technique like this utilizing maps back when normal items didn't do this. However, your design is much more compact and makes good use of the new repeater locks; plus it points out that now normal items do this too!