Questions tagged [pgcrypto]

16 questions
24
votes
3 answers

How do I install pgcrypto in PostgreSQL 8.4?

I'm using Ubuntu Server 10.10 and I have installed PostgreSQL 8.4 using apt-get install postgresql. I would like to use the built-in sha1() function, but it seems that I have to install pgcrypto first. But I don't know how to install it. There is no…
Jonas
  • 33,945
  • 27
  • 62
  • 64
19
votes
1 answer

psql 9.5: gen_random_uuid() not working

SELECT gen_random_uuid() produces output ERROR: function gen_random_uuid() does not exist SQL state: 42883 Hint: No function matches the given name and argument types. You might need to add explicit type casts. I ran CREATE EXTENSION pgcrypto; on…
d9k
  • 293
  • 1
  • 2
  • 8
8
votes
3 answers

Adding unsigned 256 bit integers in PostgreSQL

I was wondering if there would be any way to do the following in PostgreSQL: UPDATE cryptotable SET work = work + 'some big hexadecimal number' where work is an unsigned 256 bit number. Right now my column is a character varying(64) column…
Olivier Lalonde
  • 357
  • 2
  • 7
5
votes
1 answer

Do I need to execute "create extension pgcrypto" everytime?

I have used crypt() in one of my functions to hash user password. But what I observed the next day I started my pc that the same thing failed as cryptographic functions became unavailable upon restart. It showed message like functions gen_salt() /…
5
votes
1 answer

In RDS digest function is undefined after creating pgcrypto extension

On an AWS RDS instance, we have run CREATE EXTENSION pgcrypto; The extension gets created. Both queries: SELECT digest('a', 'sha256') FROM table_name; SELECT public.digest('a', 'sha256') FROM table_name; Gives the error function…
chris
  • 201
  • 2
  • 4
4
votes
2 answers

Encryption with pgcrypto

I am working on encrypting a column in a postgre table using pgcrypto. The postgre version is 9.5.1. I have figured out how to encrypt using pgp_sym_encrypt() and decrypt using pgp_sym_decrypt(). My problem is figuring out how to keep the key…
Jason
  • 339
  • 1
  • 4
  • 14
3
votes
1 answer

How do I install pgcrypto on Windows?

I would like to install pgcrypto in Windows. I have a file C:\Program\PostgreSQL\9.0\share\contrib\pgcrypto.sql but when I try to run it in psql I get an error: C:: Permission denied How do I solve this?
Jonas
  • 33,945
  • 27
  • 62
  • 64
3
votes
4 answers

How to install pgcrypto extension in postgres 10 on CentOS 7

I'm in the process of creating a postgres database for production in CentOS 7. So I already installed (yum install postgresql10-server postgresql10 after adding the repos of course) and configured postgres 10. However, in my scripts I need to…
3
votes
2 answers

Detect if `pg_crypto` in Postgres was built with strong random feature enabled

The source code for pg_crypto module mentions an option to build without cryptographically-strong random generation. /* Generate random bits. pg_backend_random() will do here, we don't promis UUIDs to be cryptographically random, when built…
Basil Bourque
  • 11,188
  • 20
  • 63
  • 96
3
votes
1 answer

Need to encrypt certain columns in a table but also be able to sort and search

We've got a web app that needs to store sensitive data entered by the user. Currently we're exploring PostgreSQL in AWS. I'm aware of pgcryto and that we can hash contents of certain columns (as not everything needs to be encrypted). However, we…
strangetimes
  • 131
  • 1
  • 2
1
vote
2 answers

Error installing pgcrypto extension

I want to install the pgcrypto extension on my postgresql installation on Windows. I found that I just have to call CREATE EXTENSION pgcrypto; but I've got an error : Syntax error on « CREATE » LINE 1: SELECT COUNT(*) AS total FROM (CREATE EXTENSION…
Maxime L
  • 31
  • 3
1
vote
0 answers

Postgres AES encryption with pgcrypto encrypt for text of length >15 characters is not compatible with other platforms

I am in a need of joining 2 tables with stringed identifiers, the key in first table is encrypted with AES ECB and the one in the second table is a raw form of that field in first table. I am trying to achieve this by doing something like CREATE…
desmostachya
  • 111
  • 3
0
votes
0 answers

Getting PAM-compatible password hashes from pgcrypto

I want to keep user records in Postgres database and faced one issue which block me. It is password encryption. For example, this is correcetly encrypted password 12345 via default Ubuntu crypt…
Alex G.P.
  • 101
  • 1
0
votes
1 answer

(PostgreSQL pgcrypto) How to generate blowfish hash without salt?

In PostgreSQL, using the pgcrypto module, I can generate a slow hash with blowfish (or any supported algorithm) like this: crypt('SomeTextHere', gen_salt('bf')); However, it auto-generates a salt (with gen_salt) and requires it. I don't want to use…
Starscream512
  • 73
  • 1
  • 6
0
votes
1 answer

How exactly are the password hashing functions in the pgcrypto module different from the regular MD5 and other algorithms?

This is not technically a database question, but about the innards of Postgres's pgcrypto extension.The documentation says The algorithms in crypt() differ from the usual MD5 or SHA1 hashing algorithms in the following respects: I would like to…
ahron
  • 833
  • 2
  • 10
  • 20
1
2