Re: paging IO and 192-bit (or any non-aligned on page size) encryption

Any stream mode can overcome this (CTR, CFB, OFB, and even CTS -
because it works on stream data, though it has a minimum data buffer
size of BLOCK_SIZE + 1, at least in my implementation).
You have to replace the original buffer anyway, so reading extra
pages is not too much extra work. It is in write, where you have to read
the previous page first, though:-)


Kind regards, Dejan M. MVP for DDK
http://www.alfasp.com E-mail: xxxxx@alfasp.com
Alfa Transparent File Encryptor - Transparent file encryption services.
Alfa File Protector - File protection and hiding library for Win32
developers.
Alfa File Monitor - File monitoring library for Win32 developers.

> So, last unclear for me here is why Dejan tell me that using of (CTR,

CFB, OFB, and even CTS…) requires additional page manipulation
efforts? Why we can’t do encryption on a 4K basis - each page
independently, but with using pointed out encryption mode on the stream
data for each page? I.e. use page size div block size as usual and left
data with previous block(s), actually?

CTR can do completely byte independent encryption/decryption so no
extra reading is needed. Other modes require other (previous/next( blocks to
do encryption/decryption on a specific block, so you have to read them in.

And what’s exact name for such encryption mode in the list of (CTR, CFB,
OFB, and even CTS) ? :slight_smile:

CTR = Counter Mode. Sometimes called Output Feedback though
OFB = Output Feedback. I am not sure which is really called what,
but CTR uses byte independent encryption for each byte of the stream (random
access stream cipher), while OFB is just a stream cipher (non random).
CFB = Cipher Feedback
CTS = Cipher Text Stealing. Similar to CBC = Cipher Block Chaining.
Others can probably give you more information on these, as
encryption is not my main thing:-)


Kind regards, Dejan M. MVP for DDK
http://www.alfasp.com E-mail: xxxxx@alfasp.com
Alfa Transparent File Encryptor - Transparent file encryption services.
Alfa File Protector - File protection and hiding library for Win32
developers.
Alfa File Monitor - File monitoring library for Win32 developers.

> Stream ciphers are not as secure, I think, but they work at the byte level.

SORT of. ECB mode itself is unsecure, and any encryption that relies
on it (even taking sector number or something else into account) is not secure
enough, because a skilled hacker can easily bypass it.
That’s why other modes exist.
Stream ciphers (except SEAL IIRC) are not applicable because they are
NOT random access, but require previous bytes to be processed first - meaning
on every read you have to read in the previous bytes and process them before
the current block.


Kind regards, Dejan M. MVP for DDK
http://www.alfasp.com E-mail: xxxxx@alfasp.com
Alfa Transparent File Encryptor - Transparent file encryption services.
Alfa File Protector - File protection and hiding library for Win32 developers.
Alfa File Monitor - File monitoring library for Win32 developers.