def VerifyPassword(user, cleartext_pwd):
 expected = GetPassword(user)
 hashed = _HashPassword(cleartext_pwd, expected['version'], expected.get('salt'))
 if (hashed != expected['hashed']):
  raise OTPException('Entered username/password invalid')

def VerifyPassword ( user , cleartext_pwd ) : expected = GetPassword ( user ) hashed = _HashPassword ( cleartext_pwd , expected [ 'version' ] , expected . get ( 'salt' ) ) if ( hashed != expected [ 'hashed' ] ) : raise OTPException ( 'Entered username/password invalid' )
encrypts the provided cleartext_pwd and compares it to the encrypted password stored for the user in the secrets db .