title: How can I decrypt a PDF using PyPDF2?
body: <p>Currently I am using the PyPDF2 as a dependency.</p>
  <p>I have encountered some encrypted files and handled
  them as you normally would (in the following code):</p>
  <pre class="lang-py prettyprint-override"><code>from PyPDF2 import PdfReader
  
  reader = PdfReader(pdf_filepath)
  if reader.is_encrypted:
      reader.decrypt(&quot;&quot;)
      print(len(reader.pages))
  </code></pre>
  <p>My filepath looks something like &quot;~/blah/FDJKL492019 21490 ,LFS.pdf&quot;
  PDF.decrypt(&quot;&quot;) returns 1, which means it was successful. But when it hits print PDF.getNumPages(),
  it still raises the error, &quot;PyPDF2.utils.PdfReadError: File has not been decrypted&quot;.</p>
  <p>How do I get rid of this error?
  I can open the PDF file just fine by double click (which default-opens with Adobe Reader).</p>