def __getMasterPassword():
 global MasterPassword
 (pw, ok) = QInputDialog.getText(None, QCoreApplication.translate(u'Crypto', u'Master Password'), QCoreApplication.translate(u'Crypto', u'Enter the master password:'), QLineEdit.Password)
 if ok:
  from .py3PBKDF2 import verifyPassword
  masterPassword = Preferences.getUser(u'MasterPassword')
  try:
   if masterPassword:
    if verifyPassword(pw, masterPassword):
     MasterPassword = pwEncode(pw)
    else:
     E5MessageBox.warning(None, QCoreApplication.translate(u'Crypto', u'Master Password'), QCoreApplication.translate(u'Crypto', u'The given password is incorrect.'))
   else:
    E5MessageBox.critical(None, QCoreApplication.translate(u'Crypto', u'Master Password'), QCoreApplication.translate(u'Crypto', u'There is no master password registered.'))
  except ValueError as why:
   E5MessageBox.warning(None, QCoreApplication.translate(u'Crypto', u'Master Password'), QCoreApplication.translate(u'Crypto', u'<p>The given password cannot be verified.</p><p>Reason: {0}'.format(str(why))))

def __getMasterPassword ( ) : global MasterPassword ( pw , ok ) = QInputDialog . getText ( None , QCoreApplication . translate ( u'Crypto' , u'Master Password' ) , QCoreApplication . translate ( u'Crypto' , u'Enter the master password:' ) , QLineEdit . Password ) if ok : from . py3PBKDF2 import verifyPassword masterPassword = Preferences . getUser ( u'MasterPassword' ) try : if masterPassword : if verifyPassword ( pw , masterPassword ) : MasterPassword = pwEncode ( pw ) else : E5MessageBox . warning ( None , QCoreApplication . translate ( u'Crypto' , u'Master Password' ) , QCoreApplication . translate ( u'Crypto' , u'The given password is incorrect.' ) ) else : E5MessageBox . critical ( None , QCoreApplication . translate ( u'Crypto' , u'Master Password' ) , QCoreApplication . translate ( u'Crypto' , u'There is no master password registered.' ) ) except ValueError as why : E5MessageBox . warning ( None , QCoreApplication . translate ( u'Crypto' , u'Master Password' ) , QCoreApplication . translate ( u'Crypto' , u'<p>The given password cannot be verified.</p><p>Reason: {0}' . format ( str ( why ) ) ) )
private module function to get the password from the user .