MessageThank you for these information.
Cary
----- Original Message -----
From: xxxxx@des.co.uk
To: File Systems Developers
Sent: Thursday, July 18, 2002 7:23 AM
Subject: [ntfsd] RE: Change file size on NTFS
Yes it can be used to encrypt any length of file. If you are new to encryption I can recommend “Applied Cryptography” (as I mentioned before) or check out
http://www.eskimo.com/~weidai/cryptlib.html
This is an excellent crypto library that covers just about everything you will ever want to do. You will need to play around with the source to get it to work in kernel mode though.
If you understand block ciphers though, and the various feedback modes, it isn`t hard to implement your own code using the reference code of the chosen algorithm as a guide.
Ben Curley
Data Encryption Systems Ltd.
-----Original Message-----
From: SurendraI [mailto:xxxxx@esntechnologies.co.in]
Sent: 18 July 2002 14:52
To: File Systems Developers
Subject: [ntfsd] RE: Change file size on NTFS
Can “Counter Mode” be used to encrypt file of size< blocksize with out changing the file size?
Could you please point me to some example?
Regards
Surendra
-----Original Message-----
From: xxxxx@des.co.uk [mailto:xxxxx@des.co.uk]
Sent: Wednesday, July 17, 2002 2:24 PM
To: File Systems Developers
Subject: [ntfsd] RE: Change file size on NTFS
Hi All,
I often see this question come up and often see poor responses from people :). Most block ciphers can be used in many different modes, not just the ones that are randomly pulled out of a hat (normally ECB + CBC). Have you ever looked at “Counter Mode” this is a modified OFB method that uses an initialisation vector (IV) + key to generate the next block for encryption. You can use this mode to encrypt any size buffer/file and simply discard what you don`t use. Counter Mode also has the ability of random access to data as block x is not dependent on the successful decryption of block x-1.
There is heaps of information available on this kind of thing. May I suggest investing in a copy of “Applied Cryptography”. All block cipher modes are discussed in detail giving pros and cons of each.
Regards
Ben Curley
Data Encryption Systems Ltd.
Website: www.des.co.uk / www.deslock.com
-----Original Message-----
From: David J. Craig [mailto:xxxxx@yoshimuni.com]
Sent: 17 July 2002 00:41
To: File Systems Developers
Subject: [ntfsd] RE: Change file size on NTFS
A different encryption algorithm is required. You can’t encrypt files of < 16 bytes with any real security with any algorithm suited for block encryption. Each 16 byte block contributes to the next block and increases encryption strength. That is why most encryption algorithms are based upon 512, 2048, or 4096 blocks. There are stream ciphers, but they are a solution for a different problem.
----- Original Message -----
From: Cary Fu
To: File Systems Developers
Sent: Tuesday, July 16, 2002 6:19 PM
Subject: [ntfsd] RE: Change file size on NTFS
Thank you very much. But how does it work when nnnnnnnn < 16?
Cary
----- Original Message -----
From: David J. Craig
To: File Systems Developers
Sent: Tuesday, July 16, 2002 1:26 PM
Subject: [ntfsd] RE: Change file size on NTFS
Let me try a diagram:
[Data nnnnnnnn bytes mod 16] [15 bytes of data]
- Encrypt the Data nnnnnnnn bytes mod 16 first.
- Take one byte from the end of the data encrypted in 1. and add to the front of the 15 byte remainder.
- Encrypt that 16 byte packet.
- Write it to the file overlaying the one byte you took out.
- Do the decryption in reverse order doing the last 16 bytes first and then the mod 16 pieces of the file.
Do NOT change file size as it just won’t work easily and is not needed for a general purpose directory based encryption program.
I think you have the filesize available in the FileObject. It is available from the FSD is you ask.
----- Original Message -----
From: Cary Fu
To: File Systems Developers
Sent: Tuesday, July 16, 2002 12:41 PM
Subject: [ntfsd] RE: Change file size on NTFS
Thank you. The step 1 as you mentioned is just what I did. The problem is, when pagging IO, I don’t have the file size, so, I have to change file size when IRP_MJ_CLOSE and IRP_MJ_SET_INFORMATION. Anyone happends to have same experience?
Cary
----- Original Message -----
From: David J. Craig
To: File Systems Developers
Sent: Monday, July 15, 2002 12:13 PM
Subject: [ntfsd] RE: Change file size on NTFS
I would suggest that no encryption of a general purpose modify the size of a file. That can and will create more problems than it solves. Step 1: a simple solution is to take the last remaining 1-15 bytes and add enough bytes from the block before it to make it 16 bytes. Encrypt/Decrypt it again and do it last on encrypt and first on decrypt - that could be reversed if desired. You need someone, not me, who understands encryption - RSA comes to mind - and can help you maintain strong encryption over the entire file. I also hope you consider CBC so a 10MB file of all zeroes doesn’t show a repeating pattern.
----- Original Message -----
From: Jamey Kirby
To: File Systems Developers
Sent: Monday, July 15, 2002 1:41 PM
Subject: [ntfsd] RE: Change file size on NTFS
It must be sector aligned (512)
-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of Cary Fu
Sent: Monday, July 15, 2002 10:00 AM
To: File Systems Developers
Subject: [ntfsd] Change file size on NTFS
HI all,
I am developing a file system filter driver doing fly encryption and decryption on Windows XP NTFS file system. Due to using block cipher (16 bytes long). I need change file size to be 16 bytes boundary. It works perfect on FAT, but on NTFS, file size after change always being resized by file system to be 8 bytes boundary. Is there someone happend to know what is wrong here? How can I change file size to 16 bytes boundary on NTFS. Thanks for any input.
Cary
You are currently subscribed to ntfsd as: xxxxx@storagecraft.com
To unsubscribe send a blank email to %%email.unsub%%
You are currently subscribed to ntfsd as: xxxxx@yoshimuni.com
To unsubscribe send a blank email to %%email.unsub%%
You are currently subscribed to ntfsd as: xxxxx@Authenexgroup.com
To unsubscribe send a blank email to %%email.unsub%%
You are currently subscribed to ntfsd as: xxxxx@yoshimuni.com
To unsubscribe send a blank email to %%email.unsub%%
You are currently subscribed to ntfsd as: xxxxx@Authenexgroup.com
To unsubscribe send a blank email to %%email.unsub%%
You are currently subscribed to ntfsd as: xxxxx@yoshimuni.com
To unsubscribe send a blank email to %%email.unsub%%
You are currently subscribed to ntfsd as: xxxxx@des.co.uk
To unsubscribe send a blank email to %%email.unsub%%
You are currently subscribed to ntfsd as: xxxxx@esntechnologies.co.in
To unsubscribe send a blank email to %%email.unsub%%
You are currently subscribed to ntfsd as: xxxxx@des.co.uk
To unsubscribe send a blank email to %%email.unsub%%
You are currently subscribed to ntfsd as: xxxxx@Authenexgroup.com
To unsubscribe send a blank email to %%email.unsub%%