2

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

Craig Ringer
  • 307,061
  • 76
  • 688
  • 778
  • Check the pgcrypto-module: http://www.postgresql.org/docs/9.3/interactive/pgcrypto.html – Frank Heikens Oct 15 '14 at 07:45
  • Encryption is not a magic secret-sauce you can add to make things secure. Really, you need to do proper threat modelling and figure out what you're protecting against, whether this is the right approach, whether you should be doing the crypto in the app or in the db, etc. – Craig Ringer Oct 15 '14 at 07:51

1 Answers1

2

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.

Community
  • 1
  • 1
Craig Ringer
  • 307,061
  • 76
  • 688
  • 778