EldoS | Feel safer!

Software components for data protection, secure storage and transfer

Writing a file larger then the BytesToWrite parameter

Also by EldoS: Rethync
The cross-platform framework that simplifies synchronizing data between mobile and desktop applications and servers and cloud storages
#32617
Posted: 03/13/2015 09:51:24
by Ighor Domingues (Basic support level)
Joined: 03/13/2015
Posts: 4

I am trying to encrypt files as well as the CBFS MapperAES sample, and I am facing a problem.

When I encrypt the buffer from the CbfsWriteFile, the encrypt result buffer size are larger then the BytesToWrite parameter because of the encryptation padding. As I am not been able to save the entire encrypted buffer with WriteFile, I'm getting decryptation problems.

Does anyone have any clue to solve this issue?
#32620
Posted: 03/13/2015 11:32:34
by Eugene Mayevski (EldoS Corp.)

You need to implement encryption with an encryption mode that supports seekable encryption (our sample does this).

The alternative is to split the data into some blocks on certain boundaries (eg. 1 Kb) and encrypt-decrypt the complete block when you need to encrypt or decrypt part of the data. This is a complicated scenario though and describing it in details would go far beyond the forum post.


Sincerely yours
Eugene Mayevski

Reply

Statistics

Topic viewed 1204 times

Number of guests: 1, registered members: 0, in total hidden: 0




|

Back to top

As of July 15, 2016 EldoS Corporation will operate as a division of /n software inc. For more information, please read the announcement.

Got it!