I'm generating a salt using the openssl_random_pseudo_bytes
function in php. However, I am unable to store the output into a PostgreSQL database.
I get an error:
ERROR: invalid byte sequence for encoding "UTF8"
Now I realize the encoding of the database in question is set to UTF8, and that the output of the function doesn't match, but what is the correct way of solving this?
This is a random salt, and I'm worried that converting it to UTF8 via whatever process will not make it cryptographically safe anymore?