Questions tagged [pgcrypto]

The pgcrypto module provides cryptographic functions for PostgreSQL.

The pgcrypto module provides cryptographic functions for PostgreSQL.

102 questions
0
votes
0 answers

Install PostgreSQL extension for non-superuser

My app's database has a dedicated user with full access like so; CREATE DATABASE "mydb" WITH OWNER = cloudsqlsuperuser ENCODING = 'UTF8' TABLESPACE = pg_default LC_COLLATE = 'en_US.UTF8' LC_CTYPE = 'en_US.UTF8' …
0
votes
0 answers

Time difference between extraction of encrypted and unencrypted data

Suppose I have two models class Student(models.Model): name = models.CharField(max_length = 60,blank= False,) subject = models.CharField(max_length = 60,blank=False) marks = models.IntegerField(default =0,blank=True) teacher =…
madrias
  • 11
  • 1
0
votes
1 answer

Python SQLALchemy use pgp_sym_decrypt for columns instead of pgp_sym_encrypt for variable in the where clause of the compiled query

I use class model for each table with method for every sql operation with SQLAlchemy. I install pgp_sym_encrypt and pgp_sym_decrypt with the extension of PostgreSQL CREATE EXTENSION IF NOT EXISTS pgcrypto WITH SCHEMA my_database; After with the…
ybz
  • 43
  • 8
0
votes
0 answers

How to use postgres pgcrypto with python?

I'm new to postgres and making an command line password manager using python. I want to hash my master password using python and store it into database. I used pgcrypto in psql shell and it worked but can't figure out how to use it with python. A…
0
votes
2 answers

psql PGP_SYM_DECRYPT : HINT: No function matches the given name and argument types

Since this morning : psql PGP_SYM_DECRYPT : HINT: No function matches the given name and argument types. LINE 1: select login,PGP_SYM_DECRYPT(password,'*******') from pa... ^ HINT: No function matches the given name and…
francois P
  • 306
  • 6
  • 20
0
votes
1 answer

Why my psql (postgreSQL) not inserting the email and password

I've created a table using the following code and I'm encrypting the password using bf. CREATE EXTENSION pgcrypto; CREATE TABLE auth ( id SERIAL PRIMARY KEY, name TEXT NOT NULL, dob DATE NOT NULL, email TEXT NOT NULL UNIQUE, password TEXT…
Divu
  • 19
  • 1
  • 9
0
votes
1 answer

Psycopg2 query from encrypted table

I run into a problem w. selecting from a encrypted column from a table using psycopg2. After having created a testtable using create table users ( id BIGSERIAL NOT NULL PRIMARY KEY, first_name VARCHAR(100) NOT NULL, last_name…
baconStrips
  • 101
  • 9
0
votes
1 answer

PostgreSQL encryption to Node.js decryption

In Postgres, I am using: encrypt('text', 'mykey', 'aes') https://www.postgresql.org/docs/8.3/pgcrypto.html - F.20.4. Raw encryption functions I assume this is done using the defaults of AES-128 algorithm, CBC mode. It appears to be stored as…
atkayla
  • 8,143
  • 17
  • 72
  • 132
0
votes
0 answers

Postgres encrypt and decrypt with different algorithms works

I'm trying to set chipher algorithm(postgres 9.6 or 12 / pgcrypto module) for encryption and decryption. But realized that pgp_sym_encrypt and pgp_sym_decrypt works with different algorithms. I didn't understand why below statement works with…
nikli
  • 2,281
  • 2
  • 24
  • 38
0
votes
1 answer

Migrate error after add new field use django-pgcrypto-fields

Migrate error after add new field use django-pgcrypto-fields My model (migrate okay in the first time) class Dkm(models.Model): name = fields.TextPGPSymmetricKeyField() value = fields.IntegerPGPSymmetricKeyField(default=0) I update model…
Vu Tran
  • 25
  • 5
0
votes
1 answer

Unable to install pgcrypto

I'm new to postgres, I need to download and install pgcrypto extension. I ran below command but nothing happened: [root@localhost /]# yum install pgcrypto Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile * base:…
Channa
  • 742
  • 17
  • 28
0
votes
0 answers

How to update an entity field column settings dynamically during runtime?

I have an entity model class called Customer that has the following field column that stores a hash of user password which is generated by PgCrypto in Postgresql: @Entity(name = "customers") @Table(name = "customers") public class Customer…
0x01Brain
  • 798
  • 2
  • 12
  • 28
0
votes
0 answers

pgcrypto and order by

I want to ORDER BY some column in such a query: SELECT "created", pgp_pub_decrypt(username, dearmor('-----BEGIN PGP PRIVATE KEY BLOCK----- XXXXXXX -----END PGP PRIVATE KEY BLOCK-----'), 'password') AS "username" FROM "users" ORDER BY…
sennin
  • 8,552
  • 10
  • 32
  • 47
0
votes
1 answer

Taking heavy fire with postgres jsonb types and pgcrypto

I have a postgres table with a jsonb column, the purpose is to insert flexible documents to then make some searches Let's begin with the table and some demonstrative data: create table my_table (id serial primary key, label text, document…
William Añez
  • 730
  • 6
  • 25
0
votes
1 answer

pgp_sym_decrypt_bytea isn't returning expected value, what am I doing wrong?

The other posts I've seen for this issue say to make sure the encrypted field is of type bytea, which mine already is. So, I'm not really sure what I'm doing wrong here. Please excuse the silly passwords, this is just testing proof of concept.…
Anwinity
  • 65
  • 1
  • 7