When setting up grub to password-protect commandline edition (see configuration hints in my comment to #545163), it can take some effort in case of error to determine whether the password is wrong, or whether it is wrongly entered because of the keyboard layout. What I wanted to do is to check that the password I expected was the one in the password_pbkdf2 statement, which required a bit of work, since grub-mkpasswd-pbkdf2 generates a new salt on each run. The attached python script generates the hashed password from the password and the salt. Comparison is lefta as an exercise through visual inspection :)