Backup fails when encrypted file copied from NTFS to FAT

Things you’d like to miss in the future...
Forum rules
:warnred20: :warnred20: :warnred20: :warnred20: :warnred20: READ THIS AND DO IT!!! :warnred20: :warnred20: :warnred20: :warnred20: :warnred20:

:info: Please include the following information:
1) Your XYplorer Version (e.g., v28.00.0801)
2) Your Windows Version (e.g., Win 11)
3) Your Screen Scaling Percentage (e.g., 125%).

:info: We strongly recommend adding your Windows Version and Screen Scaling Percentage to the Location field in your Profile or to your Signature. That way, you only have to type them once, and we won't have to search for that vital information.

:info: When attaching an Image, please use the Attachment tab at the bottom of your post and click "Add files".

:warnred20: :warnred20: :warnred20: :warnred20: :warnred20: READ THIS AND DO IT!!! :warnred20: :warnred20: :warnred20: :warnred20: :warnred20:
Tamil
Posts: 129
Joined: 10 Sep 2006 14:30
Location: .in
Contact:

Backup fails when encrypted file copied from NTFS to FAT

Post by Tamil »

Backup fails when encrypted file from NTFS is copied to FAT file system.

admin
Site Admin
Posts: 66431
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: Backup fails when encrypted file copied from NTFS to FAT

Post by admin »

Tamil wrote:Backup fails when encrypted file from NTFS is copied to FAT file system.
What happens? Error message?

Tamil
Posts: 129
Joined: 10 Sep 2006 14:30
Location: .in
Contact:

Re: Backup fails when encrypted file copied from NTFS to FAT

Post by Tamil »

admin wrote:What happens? Error message?
---------------------------
XYplorer
---------------------------
Backup from 1/11/2007 8:28:35 PM

Source: Y:\
Target: Z:\

324 copied
0 overwritten
0 not overwritten

0 failed (source too long)
0 failed (target too long)
1291 failed (for other reasons)

1615 total

---------------------------
OK
---------------------------

admin
Site Admin
Posts: 66431
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: Backup fails when encrypted file copied from NTFS to FAT

Post by admin »

Okay, thanks.

Now what should happen? I guess NTFS encryption is not compatible with FAT.

j_c_hallgren
XY Blog Master
Posts: 5826
Joined: 02 Jan 2006 19:34
Location: So. Chatham MA/Clearwater FL
Contact:

Re: Backup fails when encrypted file copied from NTFS to FAT

Post by j_c_hallgren »

admin wrote: I guess NTFS encryption is not compatible with FAT.
That's my understanding, although I've always used a FAT system...so any encryption on FAT is via a user installed product, AFAIK.
Still spending WAY TOO much time here! But it's such a pleasure helping XY be a treasure!
(XP on laptop with touchpad and thus NO mouse!) Using latest beta vers when possible.

mwb1100
Posts: 213
Joined: 19 May 2007 06:20

Re: Backup fails when encrypted file copied from NTFS to FAT

Post by mwb1100 »

admin wrote: Now what should happen? I guess NTFS encryption is not compatible with FAT.
I think that typically what happens is that the file ends up on the FAT volume in a non-encrypted state. At least that's what's documented:

http://www.microsoft.com/technet/securi ... 1.mspx#EEG
To copy a file or folder on the same computer from an NTFS partition in a Windows 2000 volume to a FAT partition. Copy the file or folder in the same manner as an unencrypted file. Use Windows Explorer or the command prompt. Because the destination file system does not support encryption, the copy is not encrypted.

admin
Site Admin
Posts: 66431
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: Backup fails when encrypted file copied from NTFS to FAT

Post by admin »

mwb1100 wrote:
admin wrote: Now what should happen? I guess NTFS encryption is not compatible with FAT.
I think that typically what happens is that the file ends up on the FAT volume in a non-encrypted state. At least that's what's documented:

http://www.microsoft.com/technet/securi ... 1.mspx#EEG
To copy a file or folder on the same computer from an NTFS partition in a Windows 2000 volume to a FAT partition. Copy the file or folder in the same manner as an unencrypted file. Use Windows Explorer or the command prompt. Because the destination file system does not support encryption, the copy is not encrypted.
I see it but I can't believe it. You plug a FAT device into a computer and decrypt data by copying them to your device? Stealing has never been simpler... well, I probably did not get it right. :?

mwb1100
Posts: 213
Joined: 19 May 2007 06:20

Re: Backup fails when encrypted file copied from NTFS to FAT

Post by mwb1100 »

admin wrote:You plug a FAT device into a computer and decrypt data by copying them to your device? Stealing has never been simpler...
Not exactly stealing, since it will only get decrypted if the user has access to the correct keys for decryption. However, it is certainly an avenue for unwittingly leaving a file decrypted.

But it's a similar situation to where you're using a TrueCrypt container or an encrypted Zip archive - if you copy a file out of the container/archive it's no longer protected.

admin
Site Admin
Posts: 66431
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: Backup fails when encrypted file copied from NTFS to FAT

Post by admin »

mwb1100 wrote:
admin wrote:You plug a FAT device into a computer and decrypt data by copying them to your device? Stealing has never been simpler...
Not exactly stealing, since it will only get decrypted if the user has access to the correct keys for decryption.
You mean you are asked for a key before copying? (Yep, I'm totally clueless in this area.)

mwb1100
Posts: 213
Joined: 19 May 2007 06:20

Re: Backup fails when encrypted file copied from NTFS to FAT

Post by mwb1100 »

Well, I happened to have a USB thumbdrive lying around so I could test this easily.

I can repro the error. Some additional information - when using a normal drag-n-drop (from XY to and Explorer window of the FAT destination) I get this dialog box:

Code: Select all

The file 'test.txt' cannot be copied or moved without losing its encryption.

You can choose to ignore this error and continue, or cancel.


     |  Ignore  | Ignore All  |  Cancel  |

I don't think this dialog was displayed back in the Win2K era, so MS has apparently done something to prevent users from unknowingly decrypting files (that's good). But in the process the reason for the failure in the XY backup operation gets lost in translation.

mwb1100
Posts: 213
Joined: 19 May 2007 06:20

Re: Backup fails when encrypted file copied from NTFS to FAT

Post by mwb1100 »

admin wrote:You mean you are asked for a key before copying? (Yep, I'm totally clueless in this area.)
No, EFS (Encrypted File System) is an NTFS feature that works pretty seamlessly. To encrypt a file or folder you simply check an attribute box (you need to press the advanced button on the property sheet). The key is automatically generated and stored by Windows in something called the Protected Storage Service so it's accessible only to that particular user.

This is the simple overview - things can be made considerable more complex in an Active Directory domain. But for testing this all you need is a version of XP/Vista that supports EFS (I think the 'Home' variants do not). Open the properties page of a file, go to the Advanced dialog and check the box that says this file should be encrypted. That's it.

admin
Site Admin
Posts: 66431
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: Backup fails when encrypted file copied from NTFS to FAT

Post by admin »

mwb1100 wrote:EFS (Encrypted File System) ...
Thanks!

admin
Site Admin
Posts: 66431
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: Backup fails when encrypted file copied from NTFS to FAT

Post by admin »

admin wrote:
mwb1100 wrote:EFS (Encrypted File System) ...
Thanks!
Okay, XY's Backup function -- contrary to the Copy function -- does not use the Shell but a lower level API named CopyFile to do the job. MS documentation says:
XP, Vista: When CopyFile is used to copy an encrypted file, it attempts to encrypt the destination file with the keys used in the encryption of the source file. If this cannot be done, this function attempts to encrypt the destination file with default keys, as in Windows 2000. If neither of these methods can be done, CopyFile fails with an ERROR_ENCRYPTION_FAILED error code.

Windows 2000: When CopyFile is used to copy an encrypted file, the function attempts to encrypt the destination file with the default keys. No attempt is made to encrypt the destination file with the keys used in the encryption of the source file. If it cannot be encrypted, CopyFile completes the copy operation without encrypting the destination file.
So you encountered the ERROR_ENCRYPTION_FAILED error, which however is currently not correctly reported by XY's backup log. I'll change that.

Under Win2000, you should get the file copied and decrypted. Can anybody confirm this?

I currently do not see a way to get the file copied and decrypted under XP/Vista. Hmm. :?
UPDATE: got it: CopyFileEx... easy :)

admin
Site Admin
Posts: 66431
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: Backup fails when encrypted file copied from NTFS to FAT

Post by admin »

Tamil wrote:Backup fails when encrypted file from NTFS is copied to FAT file system.
Fixed. Thanks!

PeterH
Posts: 2829
Joined: 21 Nov 2005 20:39
Location: DE W11Pro 24H2, 1920*1200*100% 3840*2160*150%

Re: Backup fails when encrypted file copied from NTFS to FAT

Post by PeterH »

admin wrote:
Tamil wrote:Backup fails when encrypted file from NTFS is copied to FAT file system.
Fixed. Thanks!
That means? If you cannot store it encrypted (i.e. on FAT) you store it decrypted? And if so: do you give info to the user?

Post Reply