def isUserPass(password, computedUserPass, dictU, revision):
 if (revision == 5):
  vSalt = dictU[32:40]
  inputHash = hashlib.sha256((password + vSalt)).digest()
  if (inputHash == dictU[:32]):
   return True
  else:
   return False
 elif ((revision == 3) or (revision == 4)):
  if (computedUserPass[:16] == dictU[:16]):
   return True
  else:
   return False
 elif (revision < 3):
  if (computedUserPass == dictU):
   return True
  else:
   return False

def isUserPass ( password , computedUserPass , dictU , revision ) : if ( revision == 5 ) : vSalt = dictU [ 32 : 40 ] inputHash = hashlib . sha256 ( ( password + vSalt ) ) . digest ( ) if ( inputHash == dictU [ : 32 ] ) : return True else : return False elif ( ( revision == 3 ) or ( revision == 4 ) ) : if ( computedUserPass [ : 16 ] == dictU [ : 16 ] ) : return True else : return False elif ( revision < 3 ) : if ( computedUserPass == dictU ) : return True else : return False
checks if the given password is the user password of the file .