postgres pgcrypto
# 1 CREATE EXTENSION pgcrypto; #2. encode string: SELECT encode(pgp_sym_encrypt('my string to crypt'), 'hex') as encrypted_data; # 3. SELECT pgp_sym_decrypt(decode('<crypted hash as string here>')