Search code examples
postgresqlencryptionpgcrypto

Encrypt the datas in postgresql


I am beginner in PostgreSQL. Right now, I am using PostgreSQL 9.3 Version installed in Windows Server 2008 OS. I am planing to encrypt the data in user table. I have go through most of the web sites related that, but I did not get clear idea and also encrypt function is not working. I getting error while execute this query.

select encrypt('123456789012345','1234','aes');. 

Error Message : ERROR: function encrypt(unknown, unknown, unknown) does not exist.

Can anyone help me to solve this issue.

Regards, RAM


Solution

  • You probably need to

    CREATE EXTENSION pgcrypto;
    

    first.

    However, encrypting things doesn't make them somehow "secure". Please don't assume that simply encrypting the data will actually achieve the security goal(s) you're trying to achieve.

    See:

    ... and many others.