From: ch@lathspell.de
To: pgsql-bugs@postgresql.org
Subject: BUG #6434: Wishlist: SHA-512 ("$6$" salt) for crypt()
Date: Mon, 06 Feb 2012 12:16:43 +0000
Message-ID: <E1RuNUx-0000F1-I4@wrigleys.postgresql.org> (raw)
The following bug has been logged on the website:
Bug reference: 6434
Logged by: Christian Hammers
Email address: ch@lathspell.de
PostgreSQL version: 9.1.2
Operating system: Debian GNU/Linux
Description:
The crypt() function from the pgcrypto extension is great to store and check
passwords in a format that can also be used by Linux PAM and all programming
languages that support the libc crypt() function.
Recent Linux versions started to use a crypt algorithm that is based on
SHA-512 and stores hashes in the form "$6$xxsaltxx$....." but Postgres can
only hash/verify password hashes in the old DES or the "$1$xxsaltxx$..." MD5
based format.
It would be nice if the pgcrypt extension would be extendet to support the
new SHA-256 and SHA-512 algorithms.
Further documentation on the libc implementation can be found on
http://www.akkadia.org/drepper/SHA-crypt.txt but you can probably copy it
from the OpenBSD source like you did with crypt-md5.c.
Testcase in SQL:
SELECT crypt('geheim', '$6$xxxxxxxx$');
Does give "$6C0C9PsKORBQ" but should lead to
"$6$xxxxxxxx$wuSdyeOvQXjj/nNoWnjjo.6OxUWrQFRIj019kh1cDpun6l6cpr3ywSrBprYRYZXcm4Kv9lboCEFI3GzBkdNAz/"
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-bugs@postgresql.org
Cc: ch@lathspell.de
Subject: Re: BUG #6434: Wishlist: SHA-512 ("$6$" salt) for crypt()
In-Reply-To: <E1RuNUx-0000F1-I4@wrigleys.postgresql.org>
References: <E1RuNUx-0000F1-I4@wrigleys.postgresql.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox