def pwDecrypt(epw, masterPW=None):
 if (not epw.startswith(CryptoMarker)):
  return (epw, False)
 if (masterPW is None):
  if (MasterPassword is None):
   __getMasterPassword()
   if (MasterPassword is None):
    return (u'', False)
  masterPW = pwDecode(MasterPassword)
 from .py3AES import decryptData
 from .py3PBKDF2 import rehashPassword
 (hashParameters, epw) = epw[3:].rsplit(Delimiter, 1)
 try:
  key = rehashPassword(masterPW, hashParameters)[:32]
  plaintext = decryptData(key, base64.b64decode(epw.encode(u'ascii')))
 except ValueError:
  return (u'', False)
 return (plaintext.decode(u'utf-8'), True)

def pwDecrypt ( epw , masterPW = None ) : if ( not epw . startswith ( CryptoMarker ) ) : return ( epw , False ) if ( masterPW is None ) : if ( MasterPassword is None ) : __getMasterPassword ( ) if ( MasterPassword is None ) : return ( u'' , False ) masterPW = pwDecode ( MasterPassword ) from . py3AES import decryptData from . py3PBKDF2 import rehashPassword ( hashParameters , epw ) = epw [ 3 : ] . rsplit ( Delimiter , 1 ) try : key = rehashPassword ( masterPW , hashParameters ) [ : 32 ] plaintext = decryptData ( key , base64 . b64decode ( epw . encode ( u'ascii' ) ) ) except ValueError : return ( u'' , False ) return ( plaintext . decode ( u'utf-8' ) , True )
module function to decrypt a password .