In some block modes, if we change one bit (or more) in the plaintext, the whole block\ciphertext will be changed (i.e ecb: block will be different. cbc: whole ciphertext will be different) Does encryption in OFB mode will defuse the text? if we will change one bit in the plaintext, more than one bit will be changed in the ciphertext ?
if we will change one bit in the plaintext, more than one bit will be changed in the ciphertext?
In Output Feedback Mode, no, it does not. Specifically, if you change one bit of the plaintext and nothing else (e.g. you don't modify the IV), then only the corresponding bit of the ciphertext will change.
Output Feedback Mode works by internally generating a bit string based on the key and the IV, and then exclusive-or's that bit string with the plaintext to form the ciphertext. Any mode that can be described in this way (another example, counter mode) will have this 'non-propagation' property.
This has two immediate implications:
You don't want to reuse the same (key, IV) pair to encrypt multiple messages; by xoring the ciphertexts, the attacker would recover the xor of the two plaintexts (which can tell him a lot)
You really want an integrity transform (e.g. a MAC) along with OFB mode. Without it, the attacker who guesses what the plaintext is can modify the ciphertext so that it decrypts to any plaintext he wants with the same length. Now, you generally do want to use an encryption method that has protection against modifications (such as a MAC or alternatively use an AEAD mode that provides such protection); it is critical with OFB.