Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tgKiF-009j6j-PY for pgsql-hackers@arkaria.postgresql.org; Fri, 07 Feb 2025 09:31:52 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1tgKiE-00HS95-IW for pgsql-hackers@arkaria.postgresql.org; Fri, 07 Feb 2025 09:31:50 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tgKiE-00HS8x-7D for pgsql-hackers@lists.postgresql.org; Fri, 07 Feb 2025 09:31:50 +0000 Received: from fhigh-b1-smtp.messagingengine.com ([202.12.124.152]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1tgKiA-004LOT-3C for pgsql-hackers@postgresql.org; Fri, 07 Feb 2025 09:31:49 +0000 Received: from phl-compute-04.internal (phl-compute-04.phl.internal [10.202.2.44]) by mailfhigh.stl.internal (Postfix) with ESMTP id 57B9525400B1; Fri, 7 Feb 2025 04:31:46 -0500 (EST) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-04.internal (MEProxy); Fri, 07 Feb 2025 04:31:46 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :reply-to:subject:subject:to:to:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm3; t=1738920706; x=1739007106; bh=G 2iYfo0rk7mufPHzwnoUwDTPB2YwRp1JI2PqMnqPoPU=; b=u1XTCCku/oH1t/TeH 35ZQ9tXgydBdfXLPV9PfTseqgETuNSTJSYUhtQlhmX9/y0tjKepNcMTAN9CWh1yE 79u8jayWyjG9aV4K/6Y3Lz62TzirvUVOs/OwmtWX0LpCkFijVpmVjwFa6cZc/HC9 07QrKk5Cxs17EV2z/eyGnY8fKzPpaVfHwd1fE0sA+2fl35N8r6yPoNUTkBEQvq2Y 8WrxsF/vvtttHcK4vRQYv/xgT4Slb0yzoJx6r6VXw8iACz6VSwWq6Vy9NKQGPd2M xYdoyQAqO6fM4pz/VZo1QF+pLuYMzMeXGRQT25nlEfba5OvagvjXR0rCgDaFYWgt seorw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgddvkeelfecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdp uffrtefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivg hnthhsucdlqddutddtmdenucfjughrpeffhffvvefukfggtggugfgjsehtkeertddttdej necuhfhrohhmpeetlhhvrghrohcujfgvrhhrvghrrgcuoegrlhhvhhgvrhhrvgesrghlvh hhrdhnohdqihhprdhorhhgqeenucggtffrrghtthgvrhhnpedvkedtffduffdtffffheff hfejjefhgfeiueeukeejkeffgfdufffhudffffeuveenucffohhmrghinhepvghnthgvrh hprhhishgvuggsrdgtohhmnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehm rghilhhfrhhomheprghlvhhhvghrrhgvsegrlhhvhhdrnhhoqdhiphdrohhrghdpnhgspg hrtghpthhtohepfedpmhhouggvpehsmhhtphhouhhtpdhrtghpthhtohepjhgrphhinhhl iheshhhothhmrghilhdrtghomhdprhgtphhtthhopehmrghilhhinhhgshesohhophhsfi grrhgvrdguvgdprhgtphhtthhopehpghhsqhhlqdhhrggtkhgvrhhssehpohhsthhgrhgv shhqlhdrohhrgh X-ME-Proxy: Feedback-ID: ia2694551:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 7 Feb 2025 04:31:45 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alvh.no-ip.org; s=schmee; t=1738920704; bh=XYlHeJ6RWmoblyVGwF/BmgYSYkFeo9f5tP+3+9hHdrc=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=bQAJHA1CIKEW48fAusbb2HMgDVraVockupT2hTSWMuS0CXY6agW8dSkPe56X2ZwNM 3red/FNnr4cNYj9MmUC8N6UlYyo0MKB2HNpQdWVWWlwmEHMz43evEDRXuNbguyq9Cj hg7pZOfrK1PsbkUDST/gSDIE+13AQInBZmqkbq7WM9ob+lFYZzPRrMi9EZ8z81PxiC t+pRRDW7bEptn7m8vWRMGwBgOnH3hlSLAzo7dbH7Z3m7FfwKjy2wQFInhcGb+dw3DN HEZhHj5XNFpZRdlYNlv4m4/HsreINOTdGZgw22KBwforA6Hp8X5TF80fJMHSTKDcrZ Yj6RAuHvaXSFA== Received: by schmee.alvh.no-ip.org (Postfix, from userid 1000) id 3205A95; Fri, 7 Feb 2025 10:31:44 +0100 (CET) Date: Fri, 7 Feb 2025 10:31:44 +0100 From: Alvaro Herrera To: Japin Li Cc: Bernd Helmle , PostgreSQL Development Subject: Re: Modern SHA2- based password hashes for pgcrypto Message-ID: <202502070931.7mcjufnk5g5l@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 2025-Feb-07, Japin Li wrote: > Since there is no standard, how do we handle this? I prefer to use > the strict mode like passlib. I definitely like that passlib have documented their thought process thoroughly. I think using their strict mode is good on principle, but if we're going to do that, then the salt string should not be used verbatim, but instead base64-decoded first to get the actual salt bytes, like they do. Does this break compabitibility with other systems? Are passlib-generated password hashes incompatible with, say, "openssl passwd" which you (Bernd) mentioned at the beginning of the thread? Maybe if the password hashes are no longer compatible, then we should ditch the idea of restricting salts to base64 chars and accept the whole range of bytes, like Drepper. But in any case ISTM we should reject, as they suggest, the use of less than 4 bytes of salt (and should perhaps settle for a default of 16, as passlib suggests). I suppose this is why passlib returns NULL with empty salt. What we should do in that case IMO is ereport(ERROR). -- Álvaro Herrera PostgreSQL Developer — https://www.EnterpriseDB.com/ "Porque Kim no hacía nada, pero, eso sí, con extraordinario éxito" ("Kim", Kipling)