You are on page 1of 5

Guide to recovering password protected Word and Excel documents

1
Copyright 2002 Mastermen Pty Ltd Can be copied freely but must be kept intact
1 Introduction
This guide is intended for anyone who has a password protected Word or Excel document that
they need to access. You should also refer to our software buyers guide.
This document is copyrighted by Mastermen Pty Ltd. However, it can be distributed freely as
long as it is unaltered.
2 Why recover password protected documents
In our experience, there are a number of reasons to recover a password protected document:
File open an employee may have protected an important document, and then left the
company (sometimes this is deliberate and malicious)
File open you may have simply forgotten your own password, since many people are
expected to remember a large number of passwords in their day to day life
Workbook this may have been put in place some time ago to protect formulas, which now
need to be changed
VBA a developer may have protected VBA code, although the agreement was that you
were to have access to source code
Document protection you may wish to update a document in a library
Whilst Word and Excel warn that documents cant be opened without the password, in almost all
cases, it is possible to either recover or remove the password due to weaknesses in the
algorithms used.
3 Common password types
Word and Excel use several types of password protection depending on what is actually being
protected. The approaches to recover or bypass these passwords vary, as do the effectiveness
of the different password types. The following sections outline what each type of password does,
how it works and the best approach to recover it.
3.1 File open
This is the most secure password type available in Word or Excel, and is also one of the most
commonly used types. This password protects a document from being opened without supplying
the correct password.
You can use between 1 and 15 characters, including special characters and national character
sets (since the password uses Unicode). Office 97 through to XP use relatively secure 40 bit RC4
encryption. Office XP offers a number of other cryptographic techniques. Office 95 and earlier
use a very weak encryption method, as does the French version.
Guide to recovering password protected Word and Excel documents
2
Copyright 2002 Mastermen Pty Ltd Can be copied freely but must be kept intact
3.1.1 How it works
The default protection for Office 97 onwards works by converting the entered password into an
MD5 hash, and using this as a key to encrypt the document using the secure RC4 algorithm. The
RC4 encryption algorithm strength is 40 bit, to comply with the previous US export standards. A
standard header is encrypted which helps with recovery.
For Office 95 and earlier, the password is simply XORed with the contents of the document. This
version is no longer in common use, so we wont discuss this further. However, software is
available that will recover the password instantly.
3.1.2 Recovery approaches
There are two approaches to recovering a document protected with a file open password:
Brute force try a large number of passwords from a dictionary, or by trying all possible
passwords
Key recovery recover the encryption key used, and use this to decrypt the file
3.1.3 Recommended approach
We recommend the following approach:
1. Use a dictionary attack to try all dictionary words. You should make sure that the dictionary
includes common words from the national language that the document is in. This should take
only a few minutes on most PCs.
2. Try all numbers up to 7 numbers in length.
3. Try lower case characters and numbers up to 6-7 characters in length
4. Recover encryption keys
5. Open the document, and search for the file protection password this is usually the same as
the file open password.
Software that offers only brute force and dictionary recovery approaches is not effective for most
file open passwords. In our experience, they work less than 20% of the time. This is because
most people are well educated about the need to use strong passwords, and therefore do use
long passwords which are not dictionary words and may incorporate special characters.
There are a large number of possible characters to use in a search:
A-Z = 26
a-z = 26
0 9 = 10
Special characters (!@# etc) = 32
Total standard characters = 94 (does not include non printing characters, or national characters)
This means that every character of the password has at least 94 possible combinations. This
means that for an 8 character password, the number of characters to test is:
Guide to recovering password protected Word and Excel documents
3
Copyright 2002 Mastermen Pty Ltd Can be copied freely but must be kept intact
94 x 94 x 94 x 94 x 94 x 94 x 94 x 94 = 6090 000 000 000 000
At a rate of 100,000 passwords per second, this would take 1,932 years! Remember that
passwords can be up to 15 characters long, which means that trying all possible passwords could
take millions of years.
Key recovery uses the fact that there are fewer possible encryption keys than passwords. Using
a powerful computer, or a cluster of computers, it is possible to try all the possible encryption
keys in a reasonable time. This is the best approach if initial brute force work is unsuccessful.
To select the best software, please refer to our software buyers guide at www.password-
find.com/software.html.
3.2 Worksheet protection (Excel) or document passwords (Word)
This password protects a worksheet (for example, a hidden sheet) in Excel or a protected
document in Word. It protects against overwriting content.
This uses a Microsoft protection scheme which is very insecure.
3.2.1 How it works
This type of password works by converting the entered password into a two byte hash (16 bits)
which is stored in the file. The entered password is hashed and compared to the stored hash.
Since the hash is only two bytes, a number of passwords can match the same hash. It is
possible to enter a completely different password which hashes to the same value and therefore
access the information. This protection is very insecure dont use it to protect sensitive
information!
3.2.2 Recovery approaches
Software is available that will readily find an alternate password that will provide access, however
this is invariably not the same as the original password. This works very quickly.
3.2.3 Recommended approach
Use software to find an alternate password that hashes to the same value, and use this to
unprotect the document. Refer to our software buyers guide at www.password-
find.com/software.html for more information.
Guide to recovering password protected Word and Excel documents
4
Copyright 2002 Mastermen Pty Ltd Can be copied freely but must be kept intact
3.3 VBA passwords
This password type protects VBA source code from being viewed or changed. For example, a
developer may use it to stop users from changing macros.
Different approaches are used in Office 97 (VBE 5.0) than Office 2000 and later (VBE 5.1)
This uses a proprietary Microsoft protection scheme which is very insecure (Office 97) and fairly
insecure (Office 2000 and later).
3.3.1 How it works
With Office 97, the password is protected using a simple encryption algorithm, and stored in the
file.
With Office 2000 and later, the password is hashed using the 192 bit SHA algorithm, and then
encrypted.
In neither case is the VBA itself protected only the password is encrypted. This is a key
weakness of the scheme. Consequently, in both cases the VBA source code is readily unlocked.
3.3.2 Recovery approaches
For Office 97 VBA, use software that will recover the original password.
For Office 2000 and later VBA, use software that can either replace the password with another
known password, or remove the password.
3.3.3 Recommended approach
Use software to find an alternate password that hashes to the same value, and use this to
unprotect the document. See our software buyers guide at www.password-
find.com/software.html for more information.
3.4 Office XP non-default encryption
Office XP offers a number of encryption protocols for file open passwords which are far more
secure than the default encryption. In our experience, these are not widely used.
For corporate use, we encourage IT departments to disable the secure encryption options. This
is because these make documents unrecoverable using current technology. If someone forgets
the password, there is virtually no possibility of ever recovering the contents of the document.
Guide to recovering password protected Word and Excel documents
5
Copyright 2002 Mastermen Pty Ltd Can be copied freely but must be kept intact
4 Paid service versus software
The decision to purchase software or use a recovery service is an individual one. The following
criteria can help you decide whether you need a service (such as the one provided by Password-
find), or whether you would be better off with buying software:
Use a service if you:
Have a one off recovery requirement
Have more than one type of password to recover from a document (for example, typically you
will need to buy more than one software package to recover a file open password protected
document that also has a VBA password)
Dont want to purchase and install new software
Dont have access to a computer cluster, or network to help with decrypting a file open
recovery key (since it takes around 30 days continuous processing on a single PC to recover
keys for a single document)
Are cost conscious, since a service is usually cheaper than buying software
Purchase software if you:
Have an ongoing requirement (for example, if you run a help desk)
Are interested in the recovery process and wish to experiment
Have exclusive access to a powerful computer network or cluster
Want to decrypt your own documents for personal reasons
If you wish to purchase software, check out our free objective buyers guide to software at
www.password-find.com/software.html
5 About Password-find
We provide a recovery service for all types of Word and Excel passwords, and offer a powerful
cluster computer for recovery of documents protected with file open passwords.
We also research the different types of recovery software available, and publish our
recommendations to help end users.

You might also like