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

select crypt('', 'NB');

select crypt('foox', 'NB');

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

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

drop table ctest;