Take the 2-minute tour ×
Information Security Stack Exchange is a question and answer site for Information security professionals. It's 100% free, no registration required.

For example if I use WinRAR to encrypt a file and put a password on the archive how secure is it? I keep a personal journal and am thinking of doing this, or is there a better way? It's just one huge .docx file.

Out of curiosity, can what someone writes in their journal be used to incriminate someone in court?

share|improve this question
Depends on the algorithm used by the file format. Some old "password protection" schemes just set a flag "password protected"; nowadays, there is always some sort of encryption (but then again, there are various broken encryption schemes, especially if the authors of the tool cook them up on their own). A much better option, security-wise would be using some system that has encryption as the primary goal (e.g. a TrueCrypt container), not as an afterthought to the primary function (as is the case with WinRAR). As for the legal question, ask a lawyer (no, seriously). –  Piskvor Aug 8 '12 at 9:25
"Out of curiosity, can what someone writes in their journal be used to incriminate someone in court?" Usually, yes. In the UK it's the worst: you face up to 2 or 5 years of prison (depending on the case) for not giving your encryption password - and that's besides whatever other fine or jail sentence you get for the case itself. –  Luc Aug 8 '12 at 15:05
@Luc how would they prove the defendant didn't forget the password (or it had been changed by someone else)? –  Celeritas Aug 8 '12 at 18:07
@Celeritas Exactly: they can't. Or worse: what if you have random data and they think it's encrypted? The law states, if I remember correctly, that if they can "reasonably assume" it's encrypted, you must provide the password. –  Luc Aug 8 '12 at 21:38
In case of WinRAR, people often use password, but when attacker know extension of file, it can be used to speed up brute force. For example, when attacker try to bruteforce docx document, it can be a little bit faster by checking header of file for well-known format of file. Structure of docx is XML compressed by ZIP, thus begin of decrypted/not-crypted file will be (hexa) 50 4B 03 04 and bruteforce application try to decrypt only firt 4 bytes and when first 4 bytes equal to known file-type, then try to decrypt whole file. This feature is used in advanced breakers to speed up process :-) –  user12130 Aug 10 '12 at 19:29

8 Answers 8

up vote 13 down vote accepted

Summary: yes, but use TrueCrypt instead.

From the documentation:

WinRAR offers you the benefit of industry strength archive encryption using AES (Advanced Encryption Standard) with a key of 128 bits.

So yes, the data is encrypted. This is only one of the elements of security, however. Another important element is how the key is derived from the password: what kind of key strengthening is performed? The slower the derivation of the key from the password, the more costly it is for an attacker to find the password (and hence the key) by brute force. A weak password is toast anyway, but good key strengthening can make the difference for a reasonably complex but still memorable password. WinRAR uses 262144 rounds of SHA-1 with a 64-bit salt, that's good key strengthening.

An academic paper has been written on the security of WinRAR: On the security of the WinRAR encryption feature by Gary S.-W. Yeo and Raphael C.-W. Phan (ISC'05). Quoting from the abstract (I haven't read the full text, it doesn't seem to be accessible without paying):

In this paper, we present several attacks on the encryption feature provided by the WinRAR compression software. These attacks are possible due to the subtlety in developing security software based on the integration of multiple cryptographic primitives. In other words, no matter how securely designed each primitive is, using them especially in association with other primitives does not always guarantee secure systems. Instead, time and again such a practice has shown to result in flawed systems. Our results, compared to recent attacks on WinZip by Kohno, show that WinRAR appears to offer slightly better security features.

The advantage of using the encryption built into the RAR format is that you can distribute an encrypted RAR archive to anyone with WinRAR, 7zip or other common software that supports the RAR format. For your use case, this is irrelevant. Therefore I recommend using a software that is dedicated to encryption.

The de facto standard since you're using Windows is TrueCrypt. TrueCrypt provides a virtual disk which is stored as an encrypted file. Not only is this more secure than WinRAR (I trust TrueCrypt, which is written with security in mind from day 1, far more than any product whose encryption is an ancillary feature), it is also more convenient: you mount the encrypted disk by providing your password, then you can open files on the disk transparently, and when you've finished you unmount the encrypted disk.

Out of curiousity can what someone writes in their journal be used to incriminate someone in court?

This depends on the jurisdiction, but in general, yes, as they say in the movies, anything you say or write can be used against you. You may be legally compelled to reveal encryption keys, and may face further charges if you refuse.

share|improve this answer
Weak key strengthening is one of the points I dislike about TrueCrypt. –  CodesInChaos Aug 8 '12 at 12:16
@CodesInChaos I thought I remembered it did this right… Ok, Can the TrueCrypt hash be slowed down? says 1000 iterations of SHA-512 with a good-sized salt. That's a bit fast but not altogether broken. Ah, I see that WinRAR does more iterations and uses a 64-byte salt (good enough). The use of ECB stands out as negatively, but for compressed data it's unlikely to matter. –  Gilles Aug 8 '12 at 12:37
You highly recommend Truecrypt, but I don't hear many arguments. Sure, they had security in mind since day one, but did they succeed? Is it really that much safer than WinRAR? How long would it take to crack a winrar archive vs truecrypt disk, given the same password? –  Luc Aug 8 '12 at 15:02
@Luc I'm unable to find an academic security review of TrueCrypt. There has been no recent history of bad bugs, and a success story. Note that I recommend its basic disk encryption feature, not its “plausible deniability” features (which do advertise more than what they provide). Recent versions of WinRAR and Truecrypt use the same method to derive the key from the password, but WinRAR performs more iteration, so if everything else is equal cracking should take less time with Truecrypt, but not overwhelmingly so. –  Gilles Aug 8 '12 at 16:13
@CodesInChaos It appears our information was out of date: according to the documentation, TrueCrypt uses PBKDF2, though with a lower iteration count than WinRAR. –  Gilles Aug 8 '12 at 16:14

Yes, WinRAR encrypts the archive when a password is used. I personally recommend 7-Zip application as it offers more flexibility. Yes, what you write anywhere can incriminate you as long as it is legal for the court to use that as evidence. The court can use your personal journal/diary against you. I'm not a lawyer though.

share|improve this answer

From WinRAR benefits page:

WinRAR offers you the benefit of industry strength archive encryption using AES (Advanced Encryption Standard) with a key of 128 bits.

So yes, using password protection encrypts your file too. 7-Zip uses AES-256 encryption. Another approach to protect your files could be creating encrypted file (or disk) using TrueCrypt, where you can choose encryption algorithm that suits your needs.

Just remember to use strong password to prevent brute-force attack.

share|improve this answer
The choice of encryption algorithm isn't that important unless it sucks. A bad KDF is much more common. –  CodesInChaos Aug 8 '12 at 12:14

If you are afraid of potential legal problems about what you write, then WinRAR is not secure enough. There are a lot of rar password breaking programs out there.

I would recommand TrueCrypt . But make sure Word didn't make any copies of your current document in your temp folder.

share|improve this answer

You mention "docx" so I assume that you are on Office 2007 or 2010. The encryption mechanism implemented there is OK, you must make sure that your password is strong enough. In other words you do not need to use an external program to protect your file.

A Stack Overflow question covered the encryption algorithms for Office. This is closed-source code so if you are paranoid you should use TrueCrypt.

As for the second part of the question: it completely depends on the legal system you are in. There are two aspects to take into account:

  • whether it is legal to use the content against you (no matter if it is encrypted or not)
  • what happens if you do not give the encryption key and the crypto part is strong enough / correctly implemented so that access is not possible without it.
share|improve this answer
I had a quick look at the MS Office crypto spec and it looks like the “good” encryption mode uses AES and PBKDF2, but there are legacy modes as well. How do you know you're using the good mode? –  Gilles Aug 8 '12 at 15:51
The Appendix of the document mentions that AES 128 is used by default for Office for 2007+ . I will be meeting some MS security teams by autumn so I will ask the question about legacy algorithms and update my answer. –  WoJ Aug 8 '12 at 19:18

Different archive formats offer different levels of security, but they all suffer from the same flaw: you can't actually USE the file without extracting and unencrypting it. More importantly, this is done on-disk, which means a copy of your file without encryption remains on your computer. Programs like word tend to also create auto-save files which add even more unencrypted copies.

Your best bet is a whole-disk encryption solution, of which TrueCrypt is the leading contender.

share|improve this answer

These are obviously old answers from 2012, but I'm writing this in January 2015: As of last year (2014), Truecrypt is no longer secure. Do not use Truecrypt. You can visit truecrypt.org for more information about why they are no longer secure.

share|improve this answer
+1 I was actually thinking about that. So what is used instead of truecrypt now? –  Celeritas Jan 11 at 21:08
Not really, the message states: "WARNING: Using TrueCrypt is not secure as it may contain unfixed security issues". That "may" might deceive most people as it doesn't definitely say it has security issues. From 2010 to 2014 when TC was shut down, no known security bugs were discovered, this implies security wise it's stable. –  JasonXA Apr 15 at 17:31

I feel compelled to offer some caveats because there are probably others reading this out of curiosity:

  1. The OP did not make reference to his country of residence, so I will assume that he is in the USA for the legal questions.
  2. Any encryption should be used under the assumption that it is not a foolproof security mechanism and can be breached by anyone, given enough time and force. It is - at best - a temporary hurdle that can be overcome.
  3. Anything stored electronically, whether on your computer or elsewhere, can be used against you in court provided it was obtained lawfully. It does not fall under the category of 5th Amendment privilege (not even a "journal"), nor does it vary by state or local jurisdiction. This has been to the SCOTUS multiple times and is considered settled law at this point.
  4. Failure to provide a decryption passphrase when ordered is considered contempt of court, with a penalty of imprisonment indefinitely (as long as it is withheld).

Therefore I would consider the initial questions to be irrelevant to each other.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.