Hi,
Some how this problem is not getting solve. I’m encrypting data in a very
simple way,
following is the code used by me for encrypting the data.
StoreUserMdl = Irp -> MdlAddress;
while ( StoreUserMdl != NULL )
{
MmMapLockedPages ( StoreUserMdl, KernelMode );
for ( i = 0; i <= ( ULONG ) StoreUserMdl -> ByteCount ; i++ )
{
++ * ( (PCHAR) ( StoreUserMdl -> MappedSystemVa ) + ( StoreUserMdl ->
ByteOffset + i ) );
}
StoreUserMdl = StoreUserMdl -> Next;
}// end of while
does I am doing encryption in right way or I have to do some thing else.
Thanks
Maliye
PS. Sorry till now I havn’t implemented the changes sugested by Tomas.
Because I had this great confusion with data buffer.
-----Original Message-----
From: Tomas Gutiérrez
To: Amit Gorantivar
Date: Monday, June 19, 2000 12:54 PM
Subject: RE: [ntfsd] Problem in writing encrypted data on the FAT
partition…
>Hi
>
> No, there is not more buffers, this is the way i get the write
>buffer:
>
> Buffer = MmGetSystemAddressForMdl(Irp->MdlAddress);
>
> After I get the address I copy the datas to my own buffer,
>encrypt then and send it to the lower layers.
>
>Bye.
>Tomas
>
>> -----Mensaje original-----
>> De: Amit Gorantivar [mailto:amitg@i3-micro.com]
>> Enviado el: lunes 19 de junio de 2000 11:34
>> Para: Tomas Gutiérrez
>> Asunto: Re: [ntfsd] Problem in writing encrypted data on the FAT
>> partition…
>>
>>
>> Hi,
>> Thanks for the help, but After observation, I come to the conclusion,
>> the data going to the FAT tables is not getting encrypted, it is
>> stored in
>> plain text on the disk. and when i restart machine since the FAT is in
>> unencrypted
>> form and my driver tries to decrypt the data and data gets
>> currpted, so i’m
>> not
>> able to access the drive. If i manually Encrypt the FATs then I am able
to
>> access
>> the drive and able to access the data.
>> Right now I am encrypting the data in the MDL. I think there is some more
>> buffers
>> I have to encrypt, but I don’t know which ones ? Does I’m
>> thinking in right
>> direction,
>> if yes, which additional buffers I have to encrypt.
>>
>> Thanks
>> Maliye
>> -----Original Message-----
>> From: Tomas Gutiérrez >> To: Amit Gorantivar >> Date: Friday, June 16, 2000 1:30 PM
>> Subject: RE: [ntfsd] Problem in writing encrypted data on the FAT
>> partition…
>>
>>
>> Hi
>>
>> I’m think your’re encrypting in the right way except for
>> using the upper layer buffer for encrypt the data. The FAT driver
>> always and any other applications can make a asyncronous writes
>> and use the buffer for any other thing before your completion
>> routine is called. The applications always going to get strange data
>> when reads it in this moment.
>>
>> What are you doing is what i call a physical sector encryption,
>> i didn’t realize in your previous mail if you’re encrypting files or
>> sector.
>>
>> I hope this help you. I think the first change you have to do
>> is change the write buffer on every call and test your driver again.
>> I you said that it is working fine over NTFS i’m quite sure that this
>> is your problem.
>>
>> Bye.
>> Tomas
>>
>>
>> -----Mensaje original-----
>> De: Amit Gorantivar [mailto:amitg@i3-micro.com]
>> Enviado el: viernes 16 de junio de 2000 13:03
>> Para: Tomas Gutiérrez
>> Asunto: Re: [ntfsd] Problem in writing encrypted data on the FAT
>> partition…
>>
>>
>> Hi,
>> I think i am doing the logical sector encryption. I get the sector
>> number using “currentIrpStack-Parameters.Read.ByteOffset.LowPart9”.
>>
>> What i am doing is while writing the data on the disk I encrypt it and
>> in the completion routine of the write I decrypt the data, so the will
>> remains unencrypted in the buffer.
>> But You said its simultanieous write of the FAT, I think I got problem
>> there it self. I am printing all the 512 bytes going to the FAT,
>> but What i
>> obeserved
>> is when it writes the FAT its containts are deferent from the
>> containt which
>> i read from the disk.
>> Other thing is I am using direct io mechanism, and encrypting the data
>> stored in
>> “mapped system Vartual address”,does i have to encrypt some other data
>> buffer also which
>> is i am missing. Because i also observed that when i see the FAT using
>> the
>> diskeditor utillity from the DOS the
>> data is in unencrypted form.
>>
>> also how can i use the physical sector encrypt?
>>
>> Thanks
>> Maliye
>>
>> -----Original Message-----
>> From: Tomas Gutiérrez >> To: File Systems Developers >> Cc: amitg@i3-micro.com >> Date: Friday, June 16, 2000 9:50 AM
>> Subject: RE: [ntfsd] Problem in writing encrypted data on the FAT
>> partition…
>>
>>
>> Hello
>>
>> I don’t know if you’re developing a physical sector encrypt or
>> a logical driver encrypt. If you’re developing a phyisical encryption
>> you should see no difecencies among any file system.
>>
>> Probably this is a design problem. When I developed a driver
>> like this I had a similar problem like you and it was caused by the way
>> the FAT driver writes. When you modified a file the FAT driver reads
>> the FAT modified it and writes the two copies of the FAT
>> simultanieously.
>> If you’re using the write buffer and you are not allocating a new one
>> when the FAT driver tries to write the second time the FAT the buffer
>> is encrypted and your driver encrypt it again.
>>
>> The fact is you shouldn’t encrypt the same buffer what is used
>> by the upper layers to write because this buffer can be used while it is
>> encrypted.
>>
>> Perhaps this is not your problem, if you give me more data perharps
>> I can help you.
>>
>>
>> Bye
>>
>> -----Mensaje original-----
>> De: xxxxx@lists.osr.com
>> [mailto:xxxxx@lists.osr.com]En nombre de Amit Gorantivar
>> Enviado el: jueves 15 de junio de 2000 19:42
>> Para: File Systems Developers
>> Asunto: [ntfsd] Problem in writing encrypted data on the FAT
>> partition…
>>
>>
>> Hello Friends,
>> I am writing a disk filter driver ( or rewriting
>> diskperformance monitor
>> driver ). I am doing simple encryption and decryption
>> on the data( that is incriment the ascii value of the byte by one
>> while
>> encrypting and decriment the value bye one while decrypting).
>> Right now my driver is attached to only one partition. This
>> encryption and
>> decryption works fine with the NTFS
>> partition and I am able to keep the partition in encrypted form.
>> But if the partition is FAT, while writing data on it ( creating
>> any
>> folder or any thing else), its FAT table gets currpted ?
>> when i restart the machine the partition become inaccessble. How
>> can i solve
>> this problem ?
>>
>> Thanks in advance
>> Maliye
>>
>>
>> —
>> You are currently subscribed to ntfsd as: xxxxx@jazzfree.com
>> To unsubscribe send a blank email to $subst(‘Email.Unsub’)
>>
>>
>>
>>
>>
>>
>>
>> -----Original Message-----
>> From: Tomas Gutiérrez
>> To: Amit Gorantivar
>> Date: Friday, June 16, 2000 1:30 PM
>> Subject: RE: [ntfsd] Problem in writing encrypted data on the FAT
>> partition…
>>
>>
>> >Hi
>> >
>> > I’m think your’re encrypting in the right way except for
>> >using the upper layer buffer for encrypt the data. The FAT driver
>> >always and any other applications can make a asyncronous writes
>> >and use the buffer for any other thing before your completion
>> >routine is called. The applications always going to get strange data
>> >when reads it in this moment.
>> >
>> > What are you doing is what i call a physical sector encryption,
>> >i didn’t realize in your previous mail if you’re encrypting files or
>> >sector.
>> >
>> > I hope this help you. I think the first change you have to do
>> >is change the write buffer on every call and test your driver again.
>> >I you said that it is working fine over NTFS i’m quite sure that this
>> >is your problem.
>> >
>> >Bye.
>> >Tomas
>> >
>> >
>> >> -----Mensaje original-----
>> >> De: Amit Gorantivar [mailto:amitg@i3-micro.com]
>> >> Enviado el: viernes 16 de junio de 2000 13:03
>> >> Para: Tomas Gutiérrez
>> >> Asunto: Re: [ntfsd] Problem in writing encrypted data on the FAT
>> >> partition…
>> >>
>> >>
>> >> Hi,
>> >> I think i am doing the logical sector encryption. I get the sector
>> >> number using “currentIrpStack->Parameters.Read.ByteOffset.LowPart>>9”.
>> >>
>> >> What i am doing is while writing the data on the disk I encrypt it and
>> >> in the completion routine of the write I decrypt the data, so the will
>> >> remains unencrypted in the buffer.
>> >> But You said its simultanieous write of the FAT, I think I got problem
>> >> there it self. I am printing all the 512 bytes going to the FAT,
>> >> but What i
>> >> obeserved
>> >> is when it writes the FAT its containts are deferent from the
>> >> containt which
>> >> i read from the disk.
>> >> Other thing is I am using direct io mechanism, and encrypting the data
>> >> stored in
>> >> “mapped system Vartual address”,does i have to encrypt some other data
>> >> buffer also which
>> >> is i am missing. Because i also observed that when i see the FAT using
>> the
>> >> diskeditor utillity from the DOS the
>> >> data is in unencrypted form.
>> >>
>> >> also how can i use the physical sector encrypt?
>> >>
>> >> Thanks
>> >> Maliye
>> >>
>> >> -----Original Message-----
>> >> From: Tomas Gutiérrez
>> >> To: File Systems Developers
>> >> Cc: amitg@i3-micro.com
>> >> Date: Friday, June 16, 2000 9:50 AM
>> >> Subject: RE: [ntfsd] Problem in writing encrypted data on the FAT
>> >> partition…
>> >>
>> >>
>> >> >Hello
>> >> >
>> >> >I don’t know if you’re developing a physical sector encrypt or
>> >> >a logical driver encrypt. If you’re developing a phyisical encryption
>> >> >you should see no difecencies among any file system.
>> >> >
>> >> > Probably this is a design problem. When I developed a driver
>> >> >like this I had a similar problem like you and it was caused
>> by the way
>> >> >the FAT driver writes. When you modified a file the FAT driver reads
>> >> >the FAT modified it and writes the two copies of the FAT
>> simultanieously.
>> >> >If you’re using the write buffer and you are not allocating a new one
>> >> >when the FAT driver tries to write the second time the FAT the buffer
>> >> >is encrypted and your driver encrypt it again.
>> >> >
>> >> > The fact is you shouldn’t encrypt the same buffer what is used
>> >> >by the upper layers to write because this buffer can be used
>> while it is
>> >> >encrypted.
>> >> >
>> >> > Perhaps this is not your problem, if you give me more data perharps
>> >> >I can help you.
>> >> >
>> >> >
>> >> >Bye
>> >> >
>> >> >> -----Mensaje original-----
>> >> >> De: xxxxx@lists.osr.com
>> >> >> [mailto:xxxxx@lists.osr.com]En nombre de Amit
Gorantivar
>> >> >> Enviado el: jueves 15 de junio de 2000 19:42
>> >> >> Para: File Systems Developers
>> >> >> Asunto: [ntfsd] Problem in writing encrypted data on the FAT
>> >> >> partition…
>> >> >>
>> >> >>
>> >> >> Hello Friends,
>> >> >> I am writing a disk filter driver ( or rewriting
>> >> >> diskperformance monitor
>> >> >> driver ). I am doing simple encryption and decryption
>> >> >> on the data( that is incriment the ascii value of the byte by one
>> while
>> >> >> encrypting and decriment the value bye one while decrypting).
>> >> >> Right now my driver is attached to only one partition. This
>> >> >> encryption and
>> >> >> decryption works fine with the NTFS
>> >> >> partition and I am able to keep the partition in encrypted form.
>> >> >> But if the partition is FAT, while writing data on it ( creating
>> any
>> >> >> folder or any thing else), its FAT table gets currpted ?
>> >> >> when i restart the machine the partition become inaccessble. How
>> >> >> can i solve
>> >> >> this problem ?
>> >> >>
>> >> >> Thanks in advance
>> >> >> Maliye
>> >> >>
>> >> >>
>> >> >> —
>> >> >> You are currently subscribed to ntfsd as: xxxxx@jazzfree.com
>> >> >> To unsubscribe send a blank email to
$subst(‘Email.Unsub’)
>> >> >>
>> >> >
>> >>
>> >
>> >
>>
>
>