I know that it is never suggested to use the same key or key/IV pair twice for a stream cipher or for a block cipher operating in CTR mode. Filesystem-level encryption reuses the same key for a file when it is edited.

Would it be an okay idea or a bad idea to use CTR mode for such encryption? Would it require changing the IV upon each edit and re-encrypting to make sure it is secure?

  • $\begingroup$ So, I wouldn't say that "it is never suggested" but rather that "it is catastrophic." $\endgroup$ – Xander Mar 2 '16 at 21:36

From your question I'll assume that you do not plan to use strong means of authentication along with CTR encryption. If you do, the first point is invalid.

  • Never ever use CTR mode alone. If you use CTR mode alone (i.e. without authentication) you allow attackers bit level precision for changing files. This can result in very undesirable decryptions where important data was changed because the attacker knew the format, the position and the previous content.
  • Never ever re-use a nonce + key pair. If you do re-use a {nonce, counter} and key pair, you allow an attacker to perform a ciphertext only attack (the worst sort of attack imaginable) and the complete security of the system should break down. Note further that re-using the same counter at any space-time combination suffices.
  • 3
    $\begingroup$ Furthermore, cipher modes like XTS are practically purpose-built for filesystem encryption. $\endgroup$ – Stephen Touset Mar 2 '16 at 22:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.