Search code examples
securityencryptionrijndael

Rijndael Encryption for different text generates same encrypted text?


What are the chances that a Rijndael Encryption for two different texts could generate the same encrypted text.

Say I have a plain text

"abc" > encrypts to > "defdefdef"

Can this happen?

"hij" > also encrypts to > "defdefdef"


Solution

  • For the same key, the chances are nil. Different inputs map to different outputs with the same key.

    For different keys, there is a minuscule probability that two different texts encrypted with two different keys happen to produce the same cipher text. When I say minuscule, I mean negligible. It is more likely that the Andromeda galaxy will park itself right next to the sun today.