It is the last useful day to complete the history research, much of the information you need to complete the job is enclosed in a PDF document that a friend passed you on, but trying to open it you are asked to enter a password. Another file then opens, but you are unable to print it for the same reason: you are asked for a password to continue. And now? What's now? There is no mention of calling the author of the document, since he is not at home, and the hands of the clock continue to advance inexorably.
If you want some advice, stop despairing and run for cover by learning, alone, how to unprotect a PDF with password. I already know what you are thinking: who knows what advanced technical skills and what very expensive software are needed to perform such an operation ... and instead I assure you that you are wrong! Removing the password from a PDF file, if you use the right software, can really be a breeze. In the case of documents protected only against printing (or against modification), then, the result is 100% guaranteed and can be obtained very quickly.
It is good to distinguish the passwords that are required when opening PDF files from those that are required for the application of changes or the printing of the same, as they are two different protection systems and each of them can be "pierced" in different ways and times. Going into more detail: there are owner password, which are the ones that block changes and / or PDF printing and are very easy to remove (just a few clicks and a few seconds of waiting) and then there are the user password which, on the other hand, block the opening of electronic documents and can only be removed through long brute force attacks (thus trying all possible combinations until you find the right one). For more details about it, keep reading, you will find everything explained below!
Unprotect a PDF with Password on Opening
As just said, unprotect a PDF with password it is a feasible operation but with varying difficulty: if the document to be unlocked is protected by a user password, then from a password that blocks the display, you have to attack it with a technique called Brute Force, through which all possible combinations of characters are tried until the one that makes up the right keyword is found. This procedure, as can be easily understood, can take a long time to complete (especially if the PDF password is composed of many characters and among these there are special characters) and requires a certain computing power.
Among the solutions that have allowed me to obtain the best results is PDFCrack: a free and open source program that supports unlocking PDF files on Windows, macOS and Linux. Unfortunately it only works from command line, so it doesn't have a graphical interface, but it's not very difficult to use. Now I'll explain how it works on both Windows and macOS.
If you have one PC Windows, you can download PDFCrack by connecting to the program's website and clicking on the item Download(pdfcrack-xx.zip, xxk) located in the right sidebar.
When the download is complete, open thezip archive that contains the program, extract the contents to a folder of your choice and open the Command Prompt Windows. At this point you just have to give the following commands to use PDFCrack and start searching for the password of the PDF you want to unlock.
- CD "[PDFCrack folder]", where instead of [PDFCrack folder] you have to enter the full path of the folder where you extracted PDFCrack. If you don't want to waste time, you can simply drag the folder into the prompt, after the command CD [space].
- pdfcrack "file.pdf", where instead of file.pdf you must enter the complete path and name of the file to be decrypted.
Once the command is given, PDFCrack will begin to "attack" the document to search for the password: once found, it will return the message found user-password followed by the password needed to open the file.
If you use a Poppy, you can download PDFCrack by connecting to this page of the SourceForge site and clicking on the green button Download latest version. When the download is complete, open thetar.gz archive you just downloaded and extract the contents to a folder of your choice.
Now, open the terminal macOS (which you can find in the Other of the Launchpad) and give the following commands, in order to compile the program and make it usable.
- cd [PDFCrack folder], where instead of [PDFCrack folder] you must enter the full path of the folder where you extracted PDFCrack. If you don't want to waste time, you can simply drag the folder into the Terminal after the cd [space] command.
- make -f Makefile.
When compiling is complete (this should take a few seconds), open a new window of the terminal and give the following command to know the password of your PDF.
- [PDFCrack folder] / pdfcrack -u "file.pdf", where instead of [PDFCrack folder] you must enter the full path of the folder where you extracted PDFCrack and instead of file.pdf you must enter the full path and name of the files to decrypt.
Unprotect a PDF with Password Against Printing and Modification
Do you need to unprotect a PDF that's locked against printing or editing only? In that case you are dealing with one owner password which, as mentioned at the beginning of the post, is very easy to remove. You can even turn to online services to succeed in your intent: try it!
iLovePDF is a service that offers numerous functions for editing PDFs online and protects the user's privacy. In its free version it allows you to unlock only one PDF at a time, as long as it does not exceed 80MB in weight. To remove these limits, you need to subscribe to a paid service plan, starting at 3,99 euros / month.
To unlock a PDF with iLovePDF, linked to this page of the service, drag the document of your interest to the button Select PDF file and presses the button Unlock PDF. The unlocked document will be automatically downloaded to your computer.
QPDF (Windows / MacOS / Linux)
If you do not want to be subject to the limitations imposed by online services, you can unlock your PDFs with QPDF: a free and open source software compatible with all major computer operating systems: Windows, macOS and Linux. Like PDFCrack, QPDF doesn't have a graphical interface either, it just works from command line, therefore it could be a bit difficult to use the first few times.
That said, let's take action! The first step you need to take is to download QPDF: if you use a PC WindowsHaving said that, if you use a Windows PC, connect to the SourceForge page dedicated to the program and click on the item qpdf-xx-bin-mingw64.zip a 64 bit operating system was used oppure sulla voce qpdf-xx-bin-mingw32.zip if you are using a 32-bit operating system. When the download is complete, open thezip archive which contains QPDF and extract the contents to any folder.
If you use a PoppyInstead, install Xcode and related command line tools using the Mac App Store, then open the terminal macOS and install the package manager Homebrew (a program that allows you to install, in turn, other programs via the command line) using the following command (to be confirmed by entering the Mac administration password).
- /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)".
Once Homebrew is installed, you need to install QPDF, again via the terminal, using the following command.
- brew install qpdf.
Now you can really take action and unlock your PDFs with QPDF. If you use a PC Windows, then start the Command Prompt and give the following commands.
- CD "[QPDF folder]", where instead of [QPDF folder] you have to enter the full path of the folder where you extracted QPDF. If you don't want to waste time, you can simply drag the folder into the Prompt, after the command CD [space].
- qpdf --decrypt input.pdf output.pdf, where instead of input.pdf you must enter full path and name of the file to be unlocked and instead of output.pdf full path and name of the file to be obtained as output (therefore the unlocked PDF ).
If you use a Poppyinstead, you have to open the terminal and give the following command.
- qpdf --decrypt input.pdf output.pdf, where instead of input.pdf you must enter the full path and name of the file to be unlocked and instead of output.pdf the full path and name of the file to be obtained as output.
ATTENTION: unblocking a PDF that contains private information that you are not authorized to read can lead to a serious breach of privacy or, in some cases, even the commission of a crime. This guide has been written for illustrative purposes only and, therefore, I do not take any responsibility for the use that may be made of the information contained therein.