Received: from makus.postgresql.org (makus.postgresql.org [98.129.198.125]) by mail.postgresql.org (Postfix) with ESMTP id CF1F21F32A3D for ; Mon, 6 Feb 2012 08:17:00 -0400 (AST) Received: from mahout.postgresql.org ([98.129.198.123]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1RuNVA-0004du-OY for pgsql-bugs@postgresql.org; Mon, 06 Feb 2012 12:17:00 +0000 Received: from [204.145.124.246] (helo=wrigleys.postgresql.org) by mahout.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1RuNUx-00062j-Sl for pgsql-bugs@postgresql.org; Mon, 06 Feb 2012 12:16:44 +0000 Received: from www-data by wrigleys.postgresql.org with local (Exim 4.72) (envelope-from ) id 1RuNUx-0000F1-I4 for pgsql-bugs@postgresql.org; Mon, 06 Feb 2012 12:16:43 +0000 Date: Mon, 06 Feb 2012 12:16:43 +0000 Message-Id: Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Subject: BUG #6434: Wishlist: SHA-512 ("$6$" salt) for crypt() To: pgsql-bugs@postgresql.org From: ch@lathspell.de X-Pg-Spam-Score: -1.9 (-) X-Archive-Number: 201202/65 X-Sequence-Number: 32408 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.6OxUWrQFRIj019kh1cDpun6l6cpr3ywSrBprYRYZ= Xcm4Kv9lboCEFI3GzBkdNAz/"