I couldn't come up with a good title for the question, but I hope I'll be able to make it more clear.
In some apps, such as cash machines or investment brokers, you don't insert passwords through a regular keyboard, but rather through a virtual one where each key maps to two different numbers. For example, imagine your password is 9657 and the following options appear on the interface:
- A) 4 or 2
- B) 5 or 1
- C) 3 or 7
- D) 6 or 0
- E) 8 or 9
To insert your password, you'd have to type/click: E, D, B, C. That's because E maps to 9, D maps to 6, B maps to 5 and C maps to 7.
However, since each key can map to 2 different numbers, the sequence EDBC can also map to 15 other passwords. So how do I check if the user inserted the right one?
I mean, I know brute force is an option. More specifically - we can iterate over each all the passwords generated by the sequence EDBC and check if one of them is the right password. 8653, 8657, 8613, 8617... and so on.
But is there a more efficient way to do this? Checking a password against a hash can be computationally expensive, let alone 16, 32 or 64 different passwords for each login request.
