Simulate Arduino keypad with Arduino
A CMOS quad switch can be used for matrix switch simulation using a supply >= target. Pref. sharing the same supply to prevent SCR shootthru on power cycle.  There may be other ways such as PNP arrays with input bias.

To properly simulate keypad entries that do not have N key rollover, there must be deadtime between key activation of each switch.  

Depending on your target failed attempt timeout or lockout or back-off time algorithm, it can be hacked quickly or take a long time.

So the “key”  answer is to “not key” between keys. ;) to avoid races. T=TBD