I am getting different results while executing PostgreSQL's pgp_sym_encrypt
command with same plaintext and passphrase as input. When decrypting those different results with the same passphrase, I get the correct plain text back.
I would like to understand why the encrypt function always gives different result for same plain text with the same passphrase?
Same issue with plain text, unique key and session key also.
I have created unique constraints on same column where I am getting different encryption results, hence it allows to add new record for same text multiple times.
Example:
pgp_sym_encrypt('12345','key1')
If I execute the above command two times, then I will get different output and when I decrypt the differing outputs, I will get the same plaintext back.