aboutsummaryrefslogtreecommitdiff
path: root/contrib/pgcrypto/sql/crypt-blowfish.sql
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/pgcrypto/sql/crypt-blowfish.sql')
-rw-r--r--contrib/pgcrypto/sql/crypt-blowfish.sql17
1 files changed, 17 insertions, 0 deletions
diff --git a/contrib/pgcrypto/sql/crypt-blowfish.sql b/contrib/pgcrypto/sql/crypt-blowfish.sql
new file mode 100644
index 00000000000..6b82fdff633
--- /dev/null
+++ b/contrib/pgcrypto/sql/crypt-blowfish.sql
@@ -0,0 +1,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;
+