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