Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SQL

encrypt password postgresql

CREATE EXTENSION pgcrypto;

INSERT INTO users (email, password) VALUES (
  'johndoe@mail.com',
  crypt('johnspassword', gen_salt('bf'))
);

SELECT id 
  FROM users
 WHERE email = 'johndoe@mail.com' 
   AND password = crypt('johnspassword', password);
Source by x-team.com #
 
PREVIOUS NEXT
Tagged: #encrypt #password #postgresql
ADD COMMENT
Topic
Name
1+9 =