What makes AES with Base64 generate different encryption result for the same plain text?

早过忘川 提交于 2019-12-03 20:29:11
jtahlborn

To add some clarity to the comments:

The iv or initialization vector is like a second key which is used to encrypt the data.

Since you use a random iv each time (this is good), you get different encrypted text each time. This second key is actually included with the encrypted text, so you don't need to pass it along separately.

Having just the iv doesn't enable you to crack the encryption (which is why you can pass it along with the encrypted text), but by using it, you can send the same plain text with the same password multiple times (using different ivs) and get completely different encrypted values.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!