(filename)
return
Breaks a single word password of a PDF
    Args:
        filename (str): Filename for encrypted pdf
    Returns:
        None
Breaks a single word password of a PDF
    Args:
        filename (str): Filename for encrypted pdf
    Returns:
        None
Breaks a single word password of a PDF Args : filename ( str ) : Filename for encrypted pdf Returns : None
def breakPassword(filename):
    """Breaks a single word password of a PDF
    Args:
        filename (str): Filename for encrypted pdf
    Returns:
        None
    """
    encryptedFile = open(filename, 'rb')
    pdfReader = PyPDF2.PdfFileReader(encryptedFile)

    with open('dictionary.txt') as words:
        wordList = words.read().split('\n')

    for word in wordList:
        wordLower = word.lower()
        wordCap = word.capitalize()

        if pdfReader.decrypt(word):
            return word
        elif pdfReader.decrypt(wordCap):
            return wordCap
        elif pdfReader.decrypt(wordLower):
            return wordLower

    return
def breakPassword ( filename ) : encryptedFile = open ( filename , 'rb' ) pdfReader = PyPDF2 . PdfFileReader ( encryptedFile ) with open ( 'dictionary.txt' ) as words : wordList = words . read ( ) . split ( '\n' ) for word in wordList : wordLower = word . lower ( ) wordCap = word . capitalize ( ) if pdfReader . decrypt ( word ) : return word elif pdfReader . decrypt ( wordCap ) : return wordCap elif pdfReader . decrypt ( wordLower ) : return wordLower return