Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VoGSo-0005wb-Uo for pgsql-docs@arkaria.postgresql.org; Wed, 04 Dec 2013 17:42:19 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1VoGSo-0001pN-9J for pgsql-docs@arkaria.postgresql.org; Wed, 04 Dec 2013 17:42:18 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VoGSn-0001pG-BT for pgsql-docs@postgresql.org; Wed, 04 Dec 2013 17:42:17 +0000 Received: from momjian.us ([72.94.173.45]) by magus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VoGSf-0002ur-Rh for pgsql-docs@postgresql.org; Wed, 04 Dec 2013 17:42:16 +0000 Received: from bruce by momjian.us with local (Exim 4.72) (envelope-from ) id 1VoGSe-00061h-14; Wed, 04 Dec 2013 12:42:08 -0500 Date: Wed, 4 Dec 2013 12:42:08 -0500 From: Bruce Momjian To: Miles Elam Cc: pgsql-docs@postgresql.org Subject: Re: pgcrypto docs Message-ID: <20131204174208.GF17114@momjian.us> References: <4820.1367964343@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="Y5rl02BVI9TCfPar" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.20 (2009-06-14) X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-docs Precedence: bulk Sender: pgsql-docs-owner@postgresql.org --Y5rl02BVI9TCfPar Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Tue, May 7, 2013 at 03:47:43PM -0700, Miles Elam wrote: > Personally I've found the relative times instructive, merely outdated. Perhaps > using md5 as a baseline and evaluating estimates relative to that baseline? > > md5 = 1 > sha1 = 4 > crypt-des = 7 > crypt-md5 = 1,000 > crypt-bf/5 = 12,500 > crypt-bf/6 = 25,000 > crypt-bf/7 = 50,000 > crypt-bf/8 = 100,000 > > This way, with the caveat that performance will vary from machine to machine, > there is a sense of the relative costs of using each algorithm, which does not > change as wildly with time. It lets people know how bad md5 and sha1 are for > protecting passwords et al. It also demonstrates that each turn of blowfish in > this module effectively doubles the time needed to crack and halves the number > of hashes one can perform. > > In short, I'd hate for the baby to be thrown out with the bathwater. I have used your new testing times, plus added these relative measurements, which shoud give us the best of both worlds. Patch attached; you can see the results here: http://momjian.us/tmp/pgsql/pgcrypto.html What speed was the I5 CPU you used? -- Bruce Momjian http://momjian.us EnterpriseDB http://enterprisedb.com + Everyone has their own god. + --Y5rl02BVI9TCfPar Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="crypto_timing.diff" diff --git a/doc/src/sgml/pgcrypto.sgml b/doc/src/sgml/pgcrypto.sgml new file mode 100644 index 57d3401..0d04f7e *** a/doc/src/sgml/pgcrypto.sgml --- b/doc/src/sgml/pgcrypto.sgml *************** gen_salt(type text [, iter_count integer *** 312,367 **** Hashes/sec For [a-z] For [A-Za-z0-9] crypt-bf/8 ! 28 ! 246 years ! 251322 years crypt-bf/7 ! 57 ! 121 years ! 123457 years crypt-bf/6 ! 112 ! 62 years ! 62831 years crypt-bf/5 ! 211 ! 33 years ! 33351 years crypt-md5 ! 2681 ! 2.6 years ! 2625 years crypt-des ! 362837 ! 7 days ! 19 years sha1 ! 590223 ! 4 days ! 12 years md5 hash ! 2345086 ! 1 day ! 3 years --- 312,376 ---- Hashes/sec For [a-z] For [A-Za-z0-9] + Duration relative to md5 hash crypt-bf/8 ! 1792 ! 4 years ! 3927 years ! 100k crypt-bf/7 ! 3648 ! 2 years ! 1929 years ! 50k crypt-bf/6 ! 7168 ! 1 year ! 982 years ! 25k crypt-bf/5 ! 13504 ! 188 days ! 521 years ! 12.5k crypt-md5 ! 171584 ! 15 days ! 41 years ! 1k crypt-des ! 23221568 ! 157.5 minutes ! 108 days ! 7 sha1 ! 37774272 ! 90 minutes ! 68 days ! 4 md5 hash ! 150085504 ! 22.5 minutes ! 17 days ! 1 *************** gen_salt(type text [, iter_count integer *** 374,380 **** ! The machine used is a 1.5GHz Pentium 4. --- 383,389 ---- ! The machine used is an Intel Core i5. --Y5rl02BVI9TCfPar Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-docs mailing list (pgsql-docs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-docs --Y5rl02BVI9TCfPar--