# Symmetric encryption vulnerable when encrypting and decrypting are the same?

To my understanding, symmetric encryption is where encrypting and decrypting data can occur with the same key.

It's possible for symmetric encryption that the encrypting and decrypting algorithms are the same, but this is not always the case. If I'm not mistaken, with AES this could be the case for some block modes, not for others, but I'm not 100% certain about this. (?)

A dummy example which has this property is ROT13 encryption (which therefore also happens to be ROT13 decryption).

An encryption scheme can work as follows:

1. Based on some password or key, define a deterministic stream of pseudorandom noise or garbage ("entropy stream").
2. Output data = input data XOR'ed with the entropy stream from step 1.

In this case, encrypting and decrypting are the same.

Assuming that the entropy generator in step 1 is safe (i.e. can be considered a cryptographically secure source of randomness), is the above encryption scheme sound and safe? Or are their still downsides to it compared to other symmetric encryptions, that may not have the poperty of encrypting and decrypting being the exact same algorithm?

• You're basically describing CTR and OFB mode... Jan 19, 2016 at 13:05
• Your question could be seen as asking what are the downsides of stream ciphers compared to block ciphers, correct? This security.se question tackles that, though I don't especially like the accepted answer.
– otus
Jan 19, 2016 at 15:45
• @SEJPM I guess so, yes. However with OFB mode, doesn't the entropy stream depend on encryption output from the preceding block? Jan 21, 2016 at 11:22
• @RocketNuts, OFB mode is repeated encryption of a state (the IV). The current encryption is the XOR'ed with the plain text stream to form the cipher text stream. Also see Wikipedia Jan 21, 2016 at 13:17
• more accurately, you are describing a stream cipher, of which CTR and OFB are modes which turn block ciphers into stream ciphers. You were thinking of CFB mode which does depend on the ending ciphertext of the preceding block, wheres OFB depends on the output of the preceding block cipher operation only Jan 28, 2019 at 10:17