How to secure your PDF documents with passwords (and how to crack them if needed)

Documents safety is a particularly sensitive matter due to the typical usage nature and possible value and importance of the contents. That said, users should be extra careful when sharing documents that shouldn't be leaked to other parties. Even when being careful though, this may go wrong and a shared document may fall into the wrong hands. For this reason, authors should always incorporate an additional safety net that could easily be password.

Setting up a password

Here's how to secure a PDF document with a password using LibreOffice:

You choose the “File/Export to PDF” option and navigate to the “Security” tab. There you will find the “Set Passwords” buttons that will let you set a password for opening the file, or/and a password for editing permission. After setting the passwords, you can click the “Export” button and you are done.

As simple and quick as this may be, most people out there don't add a password on their PDF files even in cases that require higher levels of security. One of the main reasons for this is the user's negligence while other reasons include the ability to crack the pass anyway, and with relative ease.

How to crack it

There is always the case that you forgot the password that you set a while ago, and now you can't open the document. Thankfully, there's a tool that is dedicated to finding passwords to PDF files that is named “pdfcrack”. Ubuntu users can install it by typing the following command on a terminal:

sudo apt-get install pdfcrack

and pressing enter.

Now open your file manager and navigate to the location of the password-secured document and open a terminal there (or navigate through your terminal by using the “cd” command to change directory). You may then use the “pdfcrack -f filename.pdf” command to let the tool run and try to guess the password. The average speed of this guessing process depends on your system resources and CPU abilities.

Now this may take ages to complete depending on your system and the complexity of the password. By pressing “ctrl+c” you can interrupt the process and save the state to savedstate.sav for resuming the process later. You can do this with the following command: “pdfcrack -f filename.pdf -l savedstate.sav”. To speed up the process, you can use some of pdfcrack's parameters to narrow down the possibilities. One way is to use the -n, or -m parameters to set the minimum and maximum integer number of characters respectively. Another way is to use the -w parameter that basically instructs the tool to search and try passwords from a word file (as shown in the below screenshot).

For more parameters, you can enter pdfcrack -help on a terminal and the various choices will be printed. Remember that howtoforge.com provides the above info for recovering lost passwords of your own files, NOT for illegitimately accessing information of locked and/or secured files.

Share this page:

7 Comment(s)

Add comment

Comments

From: iscron

you to had a some problem with google chrome icon and plank too, do you know ho to fix it?

From: Bill_Toulas

You are right I just noticed that. It's a .desktop matching problem. Here's a fix for you (and me): http://blog.steinwaywu.com/fix-duplicated-icons-in-plankdocky/

From: Aris

oke thanks for this tutorial, this article is very helpfully

From: Muhammad Qasim

Hi,

Can you please let me know which desktop theme you are using , It look awsome.

Theme, Icons, Bar ?

 

Thanks

From: m

Do you read what you tupe ?

I mean secure means safe. And you explained how to crack what you secure. Then it is not secure.

From: till

Have you read the whole tutorial? The tutorial contains two chapters, first how to secure a pdf document "Setting up a password" and a second one how to crack a password protected pdf. Both is mentioned in the tutorial title and both is described in the guide.

From: Jasmine

I don't think I am tech-savvy enough to use a command to crack PDF password, is there any tool for mac that can does the job automatically just like Cisdem PDF Password Remover? I am going to buy one but have no idea which one is better.