aboutsummaryrefslogtreecommitdiff
path: root/contrib/pgcrypto/sql/crypt-blowfish.sql
blob: 6b82fdff63372cd48cf656d092c6ca7083e8cf06 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
--
-- crypt() and gen_salt(): bcrypt
--

select crypt('', '$2a$06$RQiOJ.3ELirrXwxIZY8q0O');

select crypt('foox', '$2a$06$RQiOJ.3ELirrXwxIZY8q0O');

create table ctest (data text, res text, salt text);
insert into ctest values ('password', '', '');

update ctest set salt = gen_salt('bf', 8);
update ctest set res = crypt(data, salt);
select res = crypt(data, res) as "worked" from ctest;

drop table ctest;