Encrypt to Uncrypt
Encrypt + Encrypt = plaintext
AES mode OFB is a fully symmetric cipher as the encryption algorithm can be used to uncrypt datas.
How it works ?
Remember, ciphertext = plaintext β encrypt(iv)
so, what if the user want encrypt again the ciphertext
?
ciphertext = plaintext β encrypt(iv)
# if the user want encrypt again ciphertext then :
ciphertext2 = ciphertext β encrypt(iv)
ciphertext2 = plaintext β encrypt(iv) β encrypt(iv)
However, as explain here, the opposite of xor is xor itself, so encrypt(iv) β encrypt(iv) = 0
and x β 0 = x
so :
ciphertext2 = plaintext β encrypt(iv) β encrypt(iv)
ciphertext2 = plaintext β 0
ciphertext2 = plaintext
Last updated