LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 11-24-2013, 05:06 PM   #1
Ulysses_
Senior Member
 
Registered: Jul 2009
Posts: 1,303

Rep: Reputation: 57
Solutions to truecrypt's fatal flaw: power outage data loss


With truecrypt, power outage can cause significant data loss. Allegedly, the entire container or partition can easily be lost according to these two people:
Quote:
I lost 300GB of data due to my volume header becoming corrupted by Windows. I had my entire system encrypted (boot partition and drives) and attempted to use the various repair features and decryption to no avail.
Quote:
Truecrypt encrypted drives are extemely fragile in case of unclean shutdown, or unsafe drive removal. I've experimented a lot with truecrypt. I've tested unclean shutdowns (e.g. PC crash, power failure, reset button pressed) and unclean removal - in 100% of my tests, all data on the drive was unrecoverable.
The above are from here and here.

Any countermeasures to this flaw, like some sort of redundancy or smart scheme to deal with power outage so that one can recover as much data as possible? Using conventional recovery/file repair tools and with as little corruption as possible?

Any alternative encryption software that may take better care of power outage, disk failure, unsafe unplugging, o/s crash, corruption in the volume header etc?
 
Old 11-25-2013, 01:29 AM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Moved: This thread is more suitable in the Software Forum (not a Linux Security issue) and has been moved accordingly to help your thread/question get the exposure it deserves.

*And this really isn't some "fatal flaw" as no software that needs to keep state, modify and close files on exit is resilient in the face of power outage. If you're concerned about this use a laptop or get an UPS FCOL!
 
Old 11-25-2013, 02:08 AM   #3
everest40
Member
 
Registered: Jul 2008
Distribution: Ubuntu $LATESTVERSION
Posts: 168

Rep: Reputation: 68
TrueCrypt embeds a backup copy of the volume header in the volume, or you can make your own backup copy. From the documentation:
Quote:
If the header of a TrueCrypt volume is damaged, the volume is, in most cases, impossible to mount. Therefore, each volume created by TrueCrypt 6.0 or later contains an embedded backup header, located at the end of the volume. For extra safety, you can also create external volume header backup files. To do so, click Select Device or Select File, select the volume, select Tools > Backup Volume Header, and then follow the instructions... Both types of header backups (embedded and external) can be used to repair a damaged volume header. To do so, click Select Device or Select File, select the volume, select Tools > Restore Volume Header, and then follow the instructions.
 
Old 11-25-2013, 02:58 AM   #4
Ulysses_
Senior Member
 
Registered: Jul 2009
Posts: 1,303

Original Poster
Rep: Reputation: 57
What about the data area, doesn't a fault there affect much more data than on unencrypted storage, and what can be done about this?

Does the chosen encryption (aes etc) matter? Isn't there something about encryption principles that makes it inevitable that data chunks depend on each other no matter what scheme is used?

Hasn't anyone thought of duplicating data several times as part of the encryption to counter this?

Is truecrypt aware of a growing list of bad sectors when an entire partition is encrypted? Is any similar software aware of this?

Last edited by Ulysses_; 11-25-2013 at 03:26 AM.
 
Old 11-25-2013, 04:09 AM   #5
DanceMan
Member
 
Registered: Mar 2009
Location: Vancouver BC
Distribution: MX Linux
Posts: 159

Rep: Reputation: 22
Off-topic but related:

Power went out while transferring files from a laptop to an external usb drive. Laptop is fine because its battery kept it going, but the usb drive is not accessible. Files are likely recoverable because I suspect something in the overall file structure is scrambled; I just haven't dealt with it yet. But it did occur to me that if the drive were encrypted I'd be dealing with another level of hurt. It's good to hear that there are possible solutions for encrypted drives.
 
Old 11-25-2013, 04:27 AM   #6
everest40
Member
 
Registered: Jul 2008
Distribution: Ubuntu $LATESTVERSION
Posts: 168

Rep: Reputation: 68
Quote:
What about the data area, doesn't a fault there affect much more data than on unencrypted storage, and what can be done about this?
Does the chosen encryption (aes etc) matter? Isn't there something about encryption principles that makes it inevitable that data chunks depend on each other no matter what scheme is used?
It's not technically inevitable, but all the non-trivial encryption schemes I'm aware of do this to some extent.

Quote:
Hasn't anyone thought of duplicating data several times as part of the encryption to counter this?
People have probably thought of it. I don't mean to sound dismissive, but I wonder why you wouldn't just keep a backup copy of the encrypted volume if you're that worried about data loss. Maybe on a second physical disk if you can afford it.

Quote:
Is truecrypt aware of a growing list of bad sectors when an entire partition is encrypted? Is any similar software aware of this?
I'm not exactly knowledgable in this area, but from what I can find in TrueCrypt's documentation and on Wikipedia I get the impression that this is something of which no software would be aware.

Quoting Wikipedia:
Quote:
More detail on the health of the drive may be obtained by examining the SMART Attributes. SMART Attributes were included in some drafts of the ATA standard, but were removed before the standard became final. The meaning and interpretation of the attributes varies between manufacturers, and are sometimes considered a trade secret for one manufacturer or another.
Combine that with the fact that one of the SMART attributes is listed as "Reallocated Sectors Count", not an actual list; it seems pretty clear that software would not be able to know which sectors are bad.
 
1 members found this post helpful.
Old 11-25-2013, 04:54 AM   #7
Ulysses_
Senior Member
 
Registered: Jul 2009
Posts: 1,303

Original Poster
Rep: Reputation: 57
Thanks.

Danceman, I had the same trouble once. It was the drive's usb interface that was faulty. Try recuva first. If no luck, take out the sata drive from the usb enclosure and install it as an internal drive. Maybe try recuva on this too.

Last edited by Ulysses_; 11-25-2013 at 05:42 AM.
 
Old 11-25-2013, 05:48 AM   #8
Ulysses_
Senior Member
 
Registered: Jul 2009
Posts: 1,303

Original Poster
Rep: Reputation: 57
Quote:
Originally Posted by everest40 View Post
it seems pretty clear that software would not be able to know which sectors are bad.
So from truecrypt's point of view, a fully encrypted partition simply gets smaller as the number of bad sectors increases? Doesn't this shortening hit the backup volume header at the end or perhaps the normal volume header at the beginning?
 
Old 11-25-2013, 11:37 PM   #9
DanceMan
Member
 
Registered: Mar 2009
Location: Vancouver BC
Distribution: MX Linux
Posts: 159

Rep: Reputation: 22
Quote:
Originally Posted by Ulysses_ View Post
Thanks.

Danceman, I had the same trouble once. It was the drive's usb interface that was faulty. Try recuva first. If no luck, take out the sata drive from the usb enclosure and install it as an internal drive. Maybe try recuva on this too.
Thanks, Ulysses. I have some time now to deal with this. I'll start with your advice.
 
Old 11-26-2013, 01:04 AM   #10
haertig
Senior Member
 
Registered: Nov 2004
Distribution: Debian, Ubuntu, LinuxMint, Slackware, SysrescueCD, Raspbian, Arch
Posts: 2,331

Rep: Reputation: 357Reputation: 357Reputation: 357Reputation: 357
Quote:
I've tested unclean shutdowns (e.g. PC crash, power failure, reset button pressed) and unclean removal - in 100% of my tests, all data on the drive was unrecoverable.
My experiences have been exactly the opposite. On my wife's laptop (Windows XP) I have her profile encrypted with TrueCrypt and use their old TCGINA program to control login. That system has gone through more crashes and dirty shutdowns than one would ever imagine. Never once has any TrueCrypt data been corrupted. On other systems I've used TrueCrypt with thumbdrives and all that data has remained perfectly intact even when faced with yanking out active thumbdrives without first ejecting them. Do I recommend doing this? Crashing systems and yanking thumbdrives? Of course not. But my experience has been 0% data loss with TrueCrypt. A far cry from the other persons claim of 100% data loss.

When you find software - encryption or otherwise - that works perfectly when you yank the power cord of the computer that is running it, patent that software immediately. You'll be rich!

Trusting ANY software to protect you 100% when faced with power failures, system crashes, etc. is pure folly. Those untoward events are best protected against by frequent backups, stored offline.
 
Old 11-26-2013, 12:51 PM   #11
Ulysses_
Senior Member
 
Registered: Jul 2009
Posts: 1,303

Original Poster
Rep: Reputation: 57
Quote:
Originally Posted by haertig View Post
When you find software - encryption or otherwise - that works perfectly when you yank the power cord of the computer that is running it, patent that software immediately. You'll be rich!
The allegation against truecrypt and probably similar software is that TOO MUCH data is lost or can easily be lost, perhaps unnecessarily.

Quote:
why you wouldn't just keep a backup copy of the encrypted volume
Because a backup is substantially out-of-date most of the time. This may not be true with a time-machine/rsync kind of backup like the Mac's, or sector-map snapshots like Rollback Rx's, but they seem too complicated and recovery prospects are unknown.

Hasn't anyone thought of modifying truecrypt sources so it echoes every write to a partition to a second partition, with flushes so that only one partition is being written to at any time, therefore the other partition is guaranteed valid enough, with recovery prospects as good as if encryption were not used?

Last edited by Ulysses_; 11-26-2013 at 02:09 PM.
 
Old 11-26-2013, 01:39 PM   #12
haertig
Senior Member
 
Registered: Nov 2004
Distribution: Debian, Ubuntu, LinuxMint, Slackware, SysrescueCD, Raspbian, Arch
Posts: 2,331

Rep: Reputation: 357Reputation: 357Reputation: 357Reputation: 357
Quote:
Originally Posted by Ulysses_ View Post
Hasn't anyone thought of modifying truecrypt sources so it echoes every write to a partition to a second partition...
Do you mean kinda, sorta, like RAID? Wy not just use RAID then?
 
Old 11-26-2013, 01:50 PM   #13
Ulysses_
Senior Member
 
Registered: Jul 2009
Posts: 1,303

Original Poster
Rep: Reputation: 57
Don't both raid disks get invalidated in a sudden power outage? Raid writes in parallel, not one disk at a time.

Last edited by Ulysses_; 11-26-2013 at 01:51 PM.
 
Old 11-26-2013, 04:08 PM   #14
Ulysses_
Senior Member
 
Registered: Jul 2009
Posts: 1,303

Original Poster
Rep: Reputation: 57
Just tested and found that a tiny change in the name of a file inside a truecrypt container changes 16 bytes. This is the block size of AES as expected. Doesn't seem bad at all.

Would more blocks be affected in a crash/power outage etc, compared to the amount of data affected in a crash etc without encryption?
 
Old 11-28-2013, 12:41 PM   #15
Ulysses_
Senior Member
 
Registered: Jul 2009
Posts: 1,303

Original Poster
Rep: Reputation: 57
Any better designs that do not fail so drastically in a power outage/crash/unsafe removal and do not depend so heavily on a ups and backups of the header?
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
to improve scsi hard drive data integrity when power outage mike15 Linux - Embedded & Single-board computer 2 04-15-2012 11:22 PM
Software Raid, lots of issues after a power outage, please help me keep data itjstagame Linux - Software 3 11-22-2010 07:44 PM
LXer: Fatal Design Flaw Will Kill Windows 7 On Netbooks LXer Syndicated Linux News 0 02-07-2009 05:42 PM
Need to mount LVM volume and save Data -- Recovering from power loss. chuckcom Linux - General 1 02-09-2008 07:57 PM
power outage blackmamba11 Linux - Server 1 12-03-2007 11:51 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 12:13 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration