Software recommendation: not the usual way through the Linux software to decrypt PDF

For security reasons, we often encrypt some important PDF documents. But sometimes we need to send these documents to other people, but also do not want to tell each other the password (because it is easy to reveal their password setting habits), or even an extreme case is that they will forget the password, and then how to do? Through a number of tools and software under Linux, we can decrypt the PDF for themselves. Here we will take the Kirin Ubuntu system as an example.

Windows 10 users directly activate the system comes with a virtual machine, in the “start or close Windows features” to open the “Hyper-V “and then follow the prompts to install the necessary files to open, so that the installation of Linux systems in Hyper-V can be.

Will decrypt PDF into non-encrypted PDF

If you know the password of a PDF file, but do not want to send the encrypted PDF file directly to friends, at this time we can use Qpdf to export the encrypted PDF file as a PDF file without password.

After entering the Kirin Ubuntu system to open the encrypted file, you can see that you need to enter the PDF password to open the encrypted file, the following use Qpdf to export the PDF without encryption (Figure 1).

2018jmpdf1

Figure 1 Encrypted file cannot be opened

To download Qpdf, you can use “Uget” in the kylin Ubuntu software marketplace, open “ubuntu kylin software center” and follow the instructions to install Uget. Click “file→new download” to create a new download link, the download address is https://github.com/qpdf/qpdf/releases/download/release-qpdf-8.0.2/qpdf- 8.0.2.tar.gz (Figure 2).

2018jmpdf2

Figure 2 Download the software

After successfully completing the download, open it, extract the zip package to the desktop, open the zip package and run “install-sh” to install it. Place the PDF file you need to decrypt on the desktop assuming the file is “ywx.pdf”, click the “kylin icon → Xterm” to start the terminal, and then type “cd ~/home/ yumufa/Desktop” (note that the desktop directory is named Desktop, D is capitalized) to enter the user desktop directory, enter the command “qpdf –password=’123456′ –decrypt ywx.pdf aa.pdf “for non-encrypted export, where “123456” for the original PDF open password (Figure 3).

2018jmpdf3

Figure 3 decryption export

So back to the desktop you can see a “aa.pdf” file, now try it without the password can be opened. Thus, with the help of efficient command line, we can smoothly export encrypted files through qpdf to PDF files without password (Figure 4).

2018jmpdf4

Figure 4 to export unencrypted documents

The above method is a direct “encryption → no encryption” export, if you feel that the command-line operation is more tedious, then you can also take advantage of the “evince”, which is a GUI interface PDF reading program. After starting the program to open the encrypted PDF file, click “File → Print → select Print to File”, then in the pop-up window, the output format select pdf, and finally click Print, so that the “print” (actually for the output) is not encrypted PDF document (Figure 5).

2018jmpdf5

Figure 5 use the print method to lift the password

Violent decryption, directly open the encrypted PDF

The above method is that we need to know the PDF password in advance, and then through the output of password-free PDF documents to achieve the decryption of documents. If you completely forget the original PDF password, then you need to use pdfcrack to crack.

As above, first install the program, then start the terminal type “pdfcrack -f /home/yumufa/Desktop/ywx.pdf -n 6 -m 8 -c 0123456789”. So that the program will be set up in accordance with our requirements to brute-force cracking, if the PDf password is relatively simple in a moment you can get the results of cracking (Figure 6).

2018jmpdf6

Figure 6 Brute force cracking

Command explanation.

“-n 6”: that the shortest password length is 6 bits, -m 8: that the longest password length of 8 bits (in order to save cracking time, it is generally recommended that the length of the password are set to 6 bits, because most PDF passwords are 6 digits). “-c 0123456789”: that the password consists of characters is 0 → 9 numbers, if you determine the length of the PDF password contains other letters, then add the required letters after the characters according to the prompt can be.

PDFcrack can be seen mainly with the help of a combination of characters for violent cracking, so for complex passwords PDF documents, we can use the dictionary of violent characters to facilitate PDFcrack to call crack. The dictionary contains the number 1-10 letters A-Z and various symbols on the keyboard of any combination, cracking software will use the combination of dictionary files to try to verify one by one, for simple passwords, the use of reasonably configured dictionary files will soon be able to find the same combination so as to crack the password, you can download the commonly used password dictionary online, download it and save it in the software installation directory, and named zidian.t and name it zidian.txt (Figure 7).

2018jmpdf7

Figure 7 dictionary password

Return to the terminal window, continue to type “pdfcrack -f ywx.pdf -w zidian.txt”, so that the program will call the dictionary to crack, can be faster and more comprehensive crack (Figure 8).

2018jmpdf8

Figure 8 Using brute force dictionary crack

Write at the end

For decryption of encrypted files, it is generally more difficult under regular Windows system, and many software are charged, and worse, embedded viruses, Trojans, etc. In contrast, most of the software under Linux system is free, and because Linux system occupies less resources, you can get faster speed in violent decryption.

Leave a Comment