EldoS | Feel safer!

Software components for data protection, secure storage and transfer

Writing a file larger then the BytesToWrite parameter

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?
Posted: 03/13/2015 11:32:34
by Eugene Mayevski (Team)

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



Topic viewed 1659 times

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


Back to top

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

Got it!