2 -- crypt() and gen_salt(): bcrypt
5 SELECT crypt('', '$2a$06$RQiOJ.3ELirrXwxIZY8q0O');
7 SELECT crypt('foox', '$2a$06$RQiOJ.3ELirrXwxIZY8q0O');
9 -- error, salt too short:
10 SELECT crypt('foox', '$2a$');
12 -- error, first digit of count in salt invalid
13 SELECT crypt('foox', '$2a$40$RQiOJ.3ELirrXwxIZY8q0O');
15 -- error, count in salt too small
16 SELECT crypt('foox', '$2a$00$RQiOJ.3ELirrXwxIZY8q0O');
18 CREATE TABLE ctest (data text, res text, salt text);
19 INSERT INTO ctest VALUES ('password', '', '');
21 UPDATE ctest SET salt = gen_salt('bf', 8);
22 UPDATE ctest SET res = crypt(data, salt);
23 SELECT res = crypt(data, res) AS "worked"