~ubuntu-branches/ubuntu/oneiric/postgresql-9.1/oneiric-security

« back to all changes in this revision

Viewing changes to contrib/pgcrypto/sql/crypt-blowfish.sql

  • Committer: Bazaar Package Importer
  • Author(s): Martin Pitt
  • Date: 2011-05-11 10:41:53 UTC
  • Revision ID: james.westby@ubuntu.com-20110511104153-psbh2o58553fv1m0
Tags: upstream-9.1~beta1
ImportĀ upstreamĀ versionĀ 9.1~beta1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
--
 
2
-- crypt() and gen_salt(): bcrypt
 
3
--
 
4
 
 
5
SELECT crypt('', '$2a$06$RQiOJ.3ELirrXwxIZY8q0O');
 
6
 
 
7
SELECT crypt('foox', '$2a$06$RQiOJ.3ELirrXwxIZY8q0O');
 
8
 
 
9
CREATE TABLE ctest (data text, res text, salt text);
 
10
INSERT INTO ctest VALUES ('password', '', '');
 
11
 
 
12
UPDATE ctest SET salt = gen_salt('bf', 8);
 
13
UPDATE ctest SET res = crypt(data, salt);
 
14
SELECT res = crypt(data, res) AS "worked"
 
15
FROM ctest;
 
16
 
 
17
DROP TABLE ctest;