Here I use a Threefish kernel module with CBC mode. But there is no hash function that can supply a IV with Threefish block size (1024-bits), so I use a 64-bit random IV inserted in the dm-crypt with cryptsetup --skip option.

I know that the ideal size for an IV in CBC encryption is the same size of the block, but, what would be the consequences of using an IV smaller that the block size in CBC encryption?

PS.: I keep my IV secret (it's used in a command line inside a shell script).

  • $\begingroup$ You can encrypt the current IV and use the result as new IV, then you've randomized it, and you'd have used the key (or another key) to add the required unpredictability as 64 bits is not enough IMHO. This is what is generally provided by using ESSIV mode. Are you sure you aren't confusing ESSIV with CBC with a standard IV? $\endgroup$
    – Maarten Bodewes
    Commented May 7, 2022 at 19:23
  • $\begingroup$ XOFs are the key for your requirement - SHAKE128. If you can generate 64-bit random, you can generate 1024 bits, too. The ideal is unpredictable and no IV collision under the same key. $\endgroup$
    – kelalaka
    Commented May 7, 2022 at 20:03
  • $\begingroup$ I guess that the disk encryption software here is the limiting factor. What size of IV can it generate? If it handles AES well you'd expect at least an IV of 128 bits, reducing the amount of collisions. As for attacks, there is this Q/A where [user:poncho] shows an attack with an encryption oracle. However, it is very questionable if that attack is feasible when it comes to disk encryption. $\endgroup$
    – Maarten Bodewes
    Commented May 8, 2022 at 11:36
  • $\begingroup$ @MaartenBodewes I think so, I opened a topic in the cryptsetup repository and the author said the same; there is nothing he can do to allow a larger IV. Also, this attack that [user:poncho] described is scarring, I will use another method for encrypting my stuff. $\endgroup$ Commented May 8, 2022 at 22:29


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.