Problem with encrypted and compressed files on NTFS.

  • amr123
  • Newbie
  • Newbie
  • amr123
  • Posts: 10

Post 3+ Months Ago

Hi All,

I am using raw data-structures of NTFS to copy contents of a file in to other file.
I am traversing the data runs and copy the contents of the clusters in to other file.

It works for normal files, but if a file is encrypted or compressed it fails as new file does not have setting (Attributes) that tell File System that this file is encrypted or compressed. So file system treats this file as normal file and it does not decrypt or decompress it while reading the new file.

I want that this new file behave same as of original file.
Can any one tell me how I can achieve it?

Thanks.
  • ATNO/TW
  • Super Moderator
  • Super Moderator
  • User avatar
  • Posts: 23458
  • Loc: Woodbridge VA

Post 3+ Months Ago

Compression and Encryption are tricky when moving files. Here's a link that gives a ton of details. But there is a section there that gives you detailed info about different scenarios when moving files that might help you get it sorted.

http://www.mcmcse.com/microsoft/guides/ ... sion.shtml
Quote:
The overall rules for compression are as follows:

* Copying a file within the same NTFS volume causes the file to inherit the compression state of the target folder. When you copy a compressed file to an uncompressed folder, the file is automatically uncompressed.
* Moving a file or folder within the same NTFS volume causes the file or folder to retain its original compression state. When you move a compressed file to an uncompressed folder, the file remains compressed.
* Copying a file or folder from one NTFS volume to another causes the file or folder to inherit the compression state of the target folder. When you copy a compressed file from one NTFS volume to another, where the target folder is uncompressed, the file is automatically uncompressed.
* Moving a file or folder from one NTFS volume to another causes the file or folder to inherit the compression state of the target folder. Windows XP Professional treats a move (cut and paste) as a copy and a delete, the files inherit the compression state of the target folder.
* Moving or copying a file or folder to a FAT16 or FAT32 volume - Windows XP Professional supports attribute driven compression only on the NTFS file system, so when you move or copy a compressed NTFS file or folder to a FAT volume, (12, 16 or 32) Windows XP Professional will automatically uncompress the file or folder. If you need to maintain some level of compression in this scenario you can use the Compressed Folders feature within Windows XP Professional.
* Moving or copying a compressed file or folder to a floppy disk or other removable media - Windows XP Professional supports attribute driven compression only on the NTFS file system, so when you move or copy a compressed NTFS file or folder to most types of removable media, Windows XP Professional will automatically uncompress the file or folder because most forms of removable media do not support the NTFS file system. If you need to maintain some level of compression in this scenario you can use the Compressed Folders feature within Windows XP Professional.
  • amr123
  • Newbie
  • Newbie
  • amr123
  • Posts: 10

Post 3+ Months Ago

Hello ATNO/TW,

I have read the information on the given link but it does not solve my problem. When an encrypted file is read from disk clusters without intervention of Encrypting File System (EFS), I get data read in encrypted format in the new file. If this new file is created or moved to encrypted folder it is encrypted twice. When I open this file it is decrypted once. Thus my problem remains as it is...

How can get the original data from the encrypted one???
  • 3and1
  • Born
  • Born
  • 3and1
  • Posts: 1

Post 3+ Months Ago

I think that there are only two ways to achieve your objective.

1. you'll have to decrypt the file before you move it to another encrypted volume, which will be encrypted the second time;
2. move your encrypted file to another volume, which will not get encrypted the second time. this is probably not the best solution for you, since you would need to apply the decryption key when reading data back.

to implement the first option, i suggest looking at zecurion products. I believe they offer API for their Zserver storage encrypt decrypt data solution. what it does, it encrypts data on-the-fly when written to storage and decrypts it when the system reads it back.

Let me know if it works for you,
regards.

Post Information

  • Total Posts in this topic: 4 posts
  • Users browsing this forum: No registered users and 11 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.