2 -- crypt() and gen_salt(): extended des
5 SELECT crypt('', '_J9..j2zz');
7 SELECT crypt('foox', '_J9..j2zz');
9 -- check XDES handling of keys longer than 8 chars
10 SELECT crypt('longlongpassword', '_J9..j2zz');
12 -- error, salt too short
13 SELECT crypt('foox', '_J9..BWH');
15 -- error, count specified in the second argument is 0
16 SELECT crypt('password', '_........');
18 -- error, count will wind up still being 0 due to invalid encoding
19 -- of the count: only chars ``./0-9A-Za-z' are valid
20 SELECT crypt('password', '_..!!!!!!');
22 -- count should be non-zero here, will work
23 SELECT crypt('password', '_/!!!!!!!');
25 CREATE TABLE ctest (data text, res text, salt text);
26 INSERT INTO ctest VALUES ('password', '', '');
28 UPDATE ctest SET salt = gen_salt('xdes', 1001);
29 UPDATE ctest SET res = crypt(data, salt);
30 SELECT res = crypt(data, res) AS "worked"