简体   繁体   中英

openssl generate two different outputs from the same input

I encrypt a text using openssl as below:

openssl enc -RC4 –in file1.bin –out file2.out –e -p

then I did again using the same password, why the salt is different? And why the encrypted text is different using the exact same password?

It is randomized encryption. To be secure encryption scheme must be randomized, so it used salt (or IV) choose at random each time it encrypts data, to avoid exactly this situation. Breaking this cipher would be quite easy when there was no salt.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM