I am trying to encrypt a Postgres table column using my own algorithms. I am reading rsa key from file and encrypting data using algorithms. My column type is bytea.
When I try to insert encrypted data the Postgres gives the following error:
pg_query(): Query failed: ERROR: invalid byte sequence for encoding "UTF8": 0xa3
I tried few options setting encoding as found on internet but did not work.
I don't know what is causing this error.