head	1.6;
access;
symbols
	REL7_4_29:1.1
	REL8_0_25:1.2
	REL8_1_21:1.3
	REL8_2_17:1.3
	REL7_4_28:1.1
	REL8_0_24:1.2
	REL8_1_20:1.3
	REL8_2_16:1.3
	REL7_4_27:1.1
	REL8_0_23:1.2
	REL8_1_19:1.3
	REL8_2_15:1.3
	REL7_4_26:1.1
	REL8_0_22:1.2
	REL8_1_18:1.3
	REL8_2_14:1.3
	REL7_4_25:1.1
	REL8_0_21:1.2
	REL8_1_17:1.3
	REL8_2_13:1.3
	REL7_4_24:1.1
	REL8_0_20:1.2
	REL8_1_16:1.3
	REL8_2_12:1.3
	REL7_4_23:1.1
	REL8_0_19:1.2
	REL8_1_15:1.3
	REL8_2_11:1.3
	REL7_4_22:1.1
	REL8_0_18:1.2
	REL8_1_14:1.3
	REL8_2_10:1.3
	REL7_4_21:1.1
	REL8_0_17:1.2
	REL8_1_13:1.3
	REL8_2_9:1.3
	REL7_4_20:1.1
	REL8_0_16:1.2
	REL8_1_12:1.3
	REL8_2_8:1.3
	REL8_2_7:1.3
	REL7_3_21:1.1
	REL7_4_19:1.1
	REL8_0_15:1.2
	REL8_1_11:1.3
	REL8_2_6:1.3
	REL8_3_BETA2:1.5
	REL8_3_BETA1:1.5
	REL7_3_20:1.1
	REL7_4_18:1.1
	REL8_0_14:1.2
	REL8_1_10:1.3
	REL8_2_5:1.3
	REL7_3_19:1.1
	REL7_4_17:1.1
	REL8_0_13:1.2
	REL8_1_9:1.3
	REL8_2_4:1.3
	REL8_0_12:1.2
	REL8_1_8:1.3
	REL8_2_3:1.3
	REL7_3_18:1.1
	REL7_4_16:1.1
	REL8_0_11:1.2
	REL8_1_7:1.3
	REL8_2_2:1.3
	REL8_0_10:1.2
	REL8_1_6:1.3
	REL8_2_1:1.3
	REL7_4_15:1.1
	REL7_3_17:1.1
	REL8_2_STABLE:1.3.0.4
	REL8_2_0:1.3
	REL8_2_RC1:1.3
	REL8_2_BETA3:1.3
	REL8_2_BETA2:1.3
	REL8_1_5:1.3
	REL8_0_9:1.2
	REL7_4_14:1.1
	REL7_3_16:1.1
	REL8_2_BETA1:1.3
	REL7_3_15:1.1
	REL7_4_13:1.1
	REL8_0_8:1.2
	REL8_1_4:1.3
	REL7_3_14:1.1
	REL7_4_12:1.1
	REL8_0_7:1.2
	REL8_1_3:1.3
	REL7_3_13:1.1
	REL7_4_11:1.1
	REL8_0_6:1.2
	REL8_1_2:1.3
	REL7_3_12:1.1
	REL7_4_10:1.1
	REL8_0_5:1.2
	REL8_1_1:1.3
	REL8_1_STABLE:1.3.0.2
	REL8_1_0:1.3
	REL8_1_0RC1:1.3
	REL8_1_0BETA4:1.3
	REL8_1_0BETA3:1.3
	REL7_3_11:1.1
	REL7_4_9:1.1
	REL8_0_4:1.2
	REL8_1_0BETA2:1.2
	REL8_1_0BETA1:1.2
	REL7_2_8:1.1
	REL7_3_10:1.1
	REL7_4_8:1.1
	REL8_0_3:1.2
	REL8_0_2:1.2
	REL7_2_7:1.1
	REL7_3_9:1.1
	REL7_4_7:1.1
	REL8_0_1:1.2
	REL8_0_STABLE:1.2.0.4
	REL8_0_0:1.2.0.2
	REL8_0_0RC5:1.2
	REL8_0_0RC4:1.2
	REL8_0_0RC3:1.2
	REL8_0_0RC2:1.2
	REL8_0_0RC1:1.2
	REL8_0_0BETA5:1.2
	REL8_0_0BETA4:1.2
	REL7_4_6:1.1
	REL7_3_8:1.1
	REL7_2_6:1.1
	REL8_0_0BETA3:1.2
	REL8_0_0BETA2:1.2
	REL7_2_5:1.1
	REL7_4_5:1.1
	REL7_3_7:1.1
	REL7_4_4:1.1
	REL8_0_0BETA1:1.2
	REL7_4_3:1.1
	REL7_4_2:1.1
	REL7_3_6:1.1
	REL7_4_1:1.1
	REL7_3_5:1.1
	REL7_4:1.1
	REL7_4_RC2:1.1
	REL7_4_STABLE:1.1.0.10
	REL7_4_RC1:1.1
	REL7_4_BETA5:1.1
	REL7_4_BETA4:1.1
	REL7_4_BETA3:1.1
	REL7_4_BETA2:1.1
	WIN32_DEV:1.1.0.8
	REL7_4_BETA1:1.1
	REL7_3_4:1.1
	REL7_3_2:1.1
	REL7_2_4:1.1
	REL7_3_STABLE:1.1.0.6
	REL7_2_3:1.1
	REL7_2_STABLE:1.1.0.4
	REL7_2:1.1
	REL7_2_RC2:1.1
	REL7_2_RC1:1.1
	REL7_2_BETA5:1.1
	REL7_2_BETA4:1.1
	REL7_2_BETA3:1.1
	REL7_2_BETA2:1.1
	REL7_2_BETA1:1.1
	REL7_1_2:1.1
	REL7_1_STABLE:1.1.0.2;
locks; strict;
comment	@# @;


1.6
date	2007.11.10.23.30.45;	author momjian;	state dead;
branches;
next	1.5;

1.5
date	2007.10.01.19.06.48;	author darcy;	state Exp;
branches;
next	1.4;

1.4
date	2007.10.01.06.52.42;	author darcy;	state Exp;
branches;
next	1.3;

1.3
date	2005.09.23.15.05.04;	author tgl;	state Exp;
branches;
next	1.2;

1.2
date	2003.11.29.19.51.19;	author pgsql;	state Exp;
branches;
next	1.1;

1.1
date	2001.05.03.12.32.13;	author darcy;	state Exp;
branches;
next	;


desc
@@


1.6
log
@Move most /contrib README files into SGML.  Some still need conversion
or will never be converted.
@
text
@$PostgreSQL: pgsql/contrib/chkpass/README.chkpass,v 1.5 2007/10/01 19:06:48 darcy Exp $

Chkpass is a password type that is automatically checked and converted upon
entry.  It is stored encrypted.  To compare, simply compare against a clear
text password and the comparison function will encrypt it before comparing.
It also returns an error if the code determines that the password is easily
crackable.  This is currently a stub that does nothing.

I haven't worried about making this type indexable.  I doubt that anyone
would ever need to sort a file in order of encrypted password.

If you precede the string with a colon, the encryption and checking are
skipped so that you can enter existing passwords into the field.

On output, a colon is prepended.  This makes it possible to dump and reload
passwords without re-encrypting them.  If you want the password (encrypted)
without the colon then use the raw() function.  This allows you to use the
type with things like Apache's Auth_PostgreSQL module.

The encryption uses the standard Unix function crypt(), and so it suffers
from all the usual limitations of that function; notably that only the
first eight characters of a password are considered.

Here is some sample usage:

test=# create table test (p chkpass);
CREATE TABLE
test=# insert into test values ('hello');
INSERT 0 1
test=# select * from test;
       p
----------------
 :dVGkpXdOrE3ko
(1 row)

test=# select raw(p) from test;
      raw
---------------
 dVGkpXdOrE3ko
(1 row)

test=# select p = 'hello' from test;
 ?column?
----------
 t
(1 row)

test=# select p = 'goodbye' from test;
 ?column?
----------
 f
(1 row)

D'Arcy J.M. Cain
darcy@@druid.net

@


1.5
log
@Add some examples.
@
text
@d1 1
a1 1
$PostgreSQL: pgsql/contrib/chkpass/README.chkpass,v 1.4 2007/10/01 06:52:42 darcy Exp $
@


1.4
log
@Fix a minor typo.
@
text
@d1 1
a1 1
$PostgreSQL: pgsql/contrib/chkpass/README.chkpass,v 1.3 2005/09/23 15:05:04 tgl Exp $
d24 30
@


1.3
log
@Document that chkpass ignores password characters after the eighth.
@
text
@d1 1
a1 1
$PostgreSQL: pgsql/contrib/chkpass/README.chkpass,v 1.2 2003/11/29 19:51:19 pgsql Exp $
d4 1
a4 1
entry.  It is stored encrypted.  To compare, simply compare agains a clear
@


1.2
log
@
$Header: -> $PostgreSQL Changes ...
@
text
@d1 1
a1 1
$PostgreSQL: /cvsroot/pgsql-server/contrib/chkpass/README.chkpass,v 1.1 2001/05/03 12:32:13 darcy Exp $
d20 4
@


1.1
log
@Initial checkin of a contributed type that handles passwords efficiently.
@
text
@d1 1
a1 1
$Header$
@

