X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id A74CA5E5252 for ; Sat, 4 Sep 2004 04:26:14 +0100 (BST) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 82317-05 for ; Sat, 4 Sep 2004 03:26:10 +0000 (GMT) Received: from svr4.postgresql.org (svr4.postgresql.org [66.98.251.159]) by svr1.postgresql.org (Postfix) with ESMTP id 933305E4A75 for ; Sat, 4 Sep 2004 04:22:30 +0100 (BST) Received: from news.hub.org (news.hub.org [200.46.204.72]) by svr4.postgresql.org (Postfix) with ESMTP id 197C55AF9E1 for ; Fri, 3 Sep 2004 02:05:58 +0000 (GMT) Received: from news.hub.org (news.hub.org [200.46.204.72]) by news.hub.org (8.12.9/8.12.9) with ESMTP id i8323MLq053725 for ; Fri, 3 Sep 2004 02:03:22 GMT (envelope-from news@news.hub.org) Received: (from news@localhost) by news.hub.org (8.12.9/8.12.9/Submit) id i831o0xY051844 for pgsql-admin@postgresql.org; Fri, 3 Sep 2004 01:50:00 GMT From: Christopher Browne X-Newsgroups: comp.databases.postgresql.admin Subject: Re: Create Linux Script for PostgreSQL database backup Date: Thu, 02 Sep 2004 20:53:23 -0400 Organization: cbbrowne Computing Inc Lines: 67 Message-ID: References: <41375A29.5020806@eldocomp.com> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Complaints-To: usenet@news.hub.org X-message-flag: Outlook is rather hackable, isn't it? X-Home-Page: http://www.cbbrowne.com/info/ X-Affero: http://svcs.affero.net/rm.php?r=cbbrowne User-Agent: Gnus/5.1006 (Gnus v5.10.6) XEmacs/21.4 (Security Through Obscurity, linux) Cancel-Lock: sha1:HglXzn9h7zah4rtVYQWQf2adTZY= To: pgsql-admin@postgresql.org X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200409/33 X-Sequence-Number: 14736 Centuries ago, Nostradamus foresaw when nwalke@eldocomp.com (Naomi Walker) would write: > Anything would plain text would be a problem.  Isnt .pgpass plain > text? Yes, it's plain text. How do you propose to improve on that? At _some_ point, there has GOT to be a password in plain text form that libpq has access to, and any attempt to obfuscate it cannot provide anything better than illusory security. Suppose we decide we will store it in some "encrypted" form; libpq (or some equivalent) necessarily has _got_ to contain the decryption system, which means that anyone that can read the library and therefore read that decryption key, allowing them to decrypt the file containing the "encrypted" password. In effect, we could _pretend_ to encrypt the passwords in .pgpass, but it can't possibly provide any more security than we get storing them unencrypted. Suppose we characterize this in a sort of mathematical notation... P - plaintext password E: p ==> p' is an function mapping text into an "encrypted" form E':p' ==> p is the inverse function of E, mapping the encrypted form back into plaintext You propose that we store an encrypted form in the password file. That means that we have some tool that takes P, transforms it using function E to E(P), and puts it in the encrypted password file. But then there must be an instance of function E' either in libpq or within the postmaster. If I have access to the computer system, I therefore have access to libpq+postmaster, and thus can take that encrypted password, E(P), and use E' to find E'(E(P)) = P. That's the plaintext password; you imagined it hidden, but it wasn't, really. Public key encryption, while seemingly magical for many purposes, doesn't help with this. Functions E and E' could both be PK-related; the fact that E' MUST exist on the system means that E/E' can provide no meaningful security. This is a fundamental flaw that strikes just about any such sort of automated process that cannot resort to asking an operator for a "key." (There's an exception, bt it requires having a tamper-resistant cryptographic device connected to the computer system, and those are really expensive to manage.) I do prefer secure systems to those that aren't, but I also engage a healthy distrust in people that tell me things that I know aren't true. If someone were to claim that encrypting these passwords provided material improvements to security, they would either be lying to me, or demonstrating that they don't understand what security this would(n't) provide. If PostgreSQL Core folk claimed that encrypting the passwords provided improved security, I'd have to think uncomplimentary thoughts about them... -- (format nil "~S@~S" "cbbrowne" "cbbrowne.com") http://www3.sympatico.ca/cbbrowne/advocacy.html Science is like sex: sometimes something useful comes out, but that is not the reason we are doing it. -- Richard Feynman