fix -C stream -c rand regression.
authorAndrey Rys <rys@lynxlynx.ru>
Fri, 22 Mar 2019 09:30:17 +0000 (16:30 +0700)
committerAndrey Rys <rys@lynxlynx.ru>
Fri, 22 Mar 2019 09:30:17 +0000 (16:30 +0700)
Because "STREAM" mode has separate init function and separate encryption function,
I had a mistake to put it into a wrong place at the first time I'd ported code to
tfcipher codebase. If you did encryptions with -C stream -c rand options applied in
the past, then, to decrypt such streams you must use zero counter value together with
omitting first counter bytes from stream.

This is especially disasterous if multiple encryptions were performed with same key
since STREAM here is effectively an OFB mode of operation.
Given that this mode encourages such usage patterns, I feel sorry for such a mistake.

Still, CTR mode is better than STREAM mode because it is seekable.
From CTR, STREAM differs only in being a nonseekable mode of operation, nothing more.


No differences found