First of all, I would like to tell you guys that I'm a complete noob at cryptography in general, so please pardon any dumb stuff I may say.
Well, I have used a lot of cryptography libraries in a couple projects I have done in the past. They usually work like this:
Input:
secure = cryptography('sensitive data', 'password, salt, key, whatever');
Output:
U2FsdGVkX1/+sKF6K1TD2/wdHJRwhuwuYez4yESJxuI=
( or something like this)
Question is, when I run the exact same piece of code, the output is always different:
input:
secure = cryptography('sensitive data', 'password, salt, key, whatever');
Output:
U2FsdGVkX1+TkUfkTukfsEuSBMree9vg2I/ixgOZE1A=
(different output from the first time)
Being completely ignorant about cryptography, I don't know why do they change like this every time I run the exact same piece of code again and again.
So, I would like to know, why do they behave like this? And, is there any cryptographic algorithm that always returns the same output when the sensitive string and the key are equal no matter how many times I run the code? Thank you very much.