problem with unlocking user-password secured PDF

1.4k Views Asked by At

I have a PDF file protected by password - I know the correct user password. The problem is, that I am only able to open it on Windows Adobe Reader. Every other PDF viewer (also Linux command prompts tools for removing passwords) returns the information that password is wrong.

Potential cause: password is long (30 characters) and contains non-Latin (Polish) characters (like ł ó ę ć ź ą). I tried things like Unicode to ASCII converter, but it does not work.

Has anybody idea why it works only in Acrobat? I just want to open this document on Linux. The best would be to remove password.

EDIT: document is secured by 128-bit AES, Acrobat mention that "can be opened by Acrobat 7.0 or newer". Printing, copying, etc is not allowed.

EDIT2: thanks for helping in comments, I tried SumatraPDF and it works - but only allow to print this to non-searchable images pdf. I checked that it is based on mupdf engine, but mupdf on Linux cannot deal with this file - it crash. Sumatra has open source, do anybody knows how to edit it to print to PDF in normal way?

1

There are 1 best solutions below

1
K J On

SumatraPDF uses MuPDF as its engine for several formats such as ePub HTML and of course PDF. It can store (not remove) a know password as a hash so no need to keep inputting for everyday reading or adding comments to a PDF.

So if as suggested by @mkl using the password with local characters on a local PC may work in SumatraPDF it should work in MuPDF-GL which is a more basic viewer. Spoiler, certainly I can remove my own simple 9 character encrypted challenge.pdf (8 sequentially alphabetic characters are a known semi random sequence) to save in MuPDF as unprotected.pdf, but nobody has cracked it yet :-)

However MuPDF-GL has many more powerful abilities hidden under the surface.

Using MuPDF-GL you should be able to open the file when it prompts for that password. then press A which starts the annotator (you dont need to add anything) but simply change the save as settings.

So in this case if there were errors it will have fixed any needed to re-save but first switch OFF incremental and set encryption to none. There is no guarantee this will work for all cases but worth a try. enter image description here

IF mupdf-gl does not work for you on linux you can try

MuTool mutool draw -p password -o unprotected.pdf protected.pdf

OR qpdf which can also rebuild a PDF with different restrictions given the correct input password(s).

qpdf --password=myverylongstring!"^$% --decrypt protected.pdf unprotected.pdf

or if the password may cause commandline UTF problems save it as first line of a text file and use

qpdf -password-file=password.txt --decrypt protected.pdf unprotected.pdf

Lastly if you wish to print a pdf file on Linux you have two potential options as readers OLD Evince works for me on Windows 32bit but for 64bit I prefer nightly cutting edge Okular.