In Postgres, I am using:
encrypt('text', 'mykey', 'aes')
https://www.postgresql.org/docs/8.3/pgcrypto.html - F.20.4. Raw encryption functions
I assume this is done using the defaults of AES-128 algorithm, CBC mode.
It appears to be stored as BINARY (16 bytes) in the database and comes back as a base64? encoded string when I request the column on the server with my ORM.
In Node.js, assuming I have 'mykey', how do I convert this value back to its plaintext using crypto
or crypto-js
libraries?