Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to hide value in database PostgreSQL

Tags:

postgresql

Anybody can help me regarding the database postgres? I need to hide the value in table that was created.I need to hide the data password as like below example:

username password ana 123

I want the password appear like * Can anyone help me? Thank you in advance.

like image 266
ana Avatar asked Apr 23 '26 13:04

ana


2 Answers

Take a look at pgcrypto module for some more options (like Extended DES crypt and PGP encryption). I don't recommend using MD5, because (IMHO) it's easily breakable nowadays (especially without any salt). Better choice is SHA-512 (or some of SHA-3 candidates: BLAKE, Grøstl etc.).

I think that it's good idea to check your hiding method against some (possibly GPU-accelerated) tools like hashcat. It really depends how valuable data you want to store.

like image 132
Grzegorz Szpetkowski Avatar answered Apr 27 '26 16:04

Grzegorz Szpetkowski


The usual, and best, way is to store the MD5 of the password and compare that with the MD5 of the password entered. It fairly safe (but brute force can crack it given enough time).

like image 45
Bohemian Avatar answered Apr 27 '26 15:04

Bohemian



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!