Hi,
I created a OSX application that mounts a virtual file system using OSXFuse. I would like to integrate AES-256 bit encryption services with my application. The encryption library I am using encrypts the data in 1082 byte blocks.
The issue I am having is on the decryption side of things. I have an encrypted file residing in a folder which is processed via the openFileAtPath and readFileAtPath methods. I perform my decryption logic within readFileAtPath.
Issue - readFileAtPath provides the data to me in blocks of a certain size. For example.. OSXFuse will call readFileAtPath on an encrypted file with size at 4096 bytes. I decrypt the data in 1082 byte blocks. I can decrypt three of these blocks or 3246 bytes of data and save the rest to be processed on the next read. However when control exits readFileAtPath, buffer is holding 3246 bytes of decrypted data.. not 4096 bytes that OSXFuse expects. This causes it to resend the last 850 bytes in the next read which throws everything off.
I have tried specifying the return value of readFileAtPath to match that of what we receive when we read the file (i.e, 4096 bytes) but this causes corruption in the returned data.. I have tried specifying the return value of readFileAtPath to what we actually process (three blocks of encrypted data or 3,246 bytes), but this causes OSXFuse to make subsequent readFileAtPath calls with previously sent data as noted earlier..
So my question is.. is there a way to get OsxFuse to properly compensate for the encrypted data? Is there a way for me to control the size parameter that is supplied in readFileAtPath?
Any ideas or thought would be very helpful.
Thanks,
--Fred
--
You received this message because you are subscribed to the Google Groups "OSXFUSE" group.
To unsubscribe from this group and stop receiving emails from it, send an email to osxfuse-grou...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
--
- (int)readFileAtPath:(NSString *)path
userData:(id)userData
buffer:(char *)buffer
size:(size_t)size
offset:(off_t)offset
error:(NSError **)error