I tested this script in Postgresql:
select encode(encrypt('123456','F2388451B0954326','aes'),'BASE64');
But, this is AES128 encryption. How can I use aes-256 encryption in PostgreSQL?
You can use pgcrypto extension, install it with:
create extension pgcrypto
now, after pgcrypto installed successfully, use pgp_sym_encrypt function
select encode(pgp_sym_encrypt('123456','F2388451B0954326','compress-algo=1, cipher-algo=aes256'),'BASE64');
please note that first parameter '123456' is data, second parameter is password
hope that answer your question
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With