"I was having the same problem yesterday while rooting my redmi 5 plus. so what I did was, when it asks for password, just hit cancel and go to wipe and do a factory reset. after that don't reboot, instead connect to the computer and transfer either magisk or supersu to the phone and flash it and then reboot and it will not ask for password any more. it worked for me and I hope it will work for you too"