Openwall GNU/*/Linux - a small security-enhanced Linux distro for servers
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Thu, 09 Feb 2012 10:32:07 +0100
From: magnum <john.magnum@...hmail.com>
To: john-dev@...ts.openwall.com
Subject: Re: Drupal 7

On 02/09/2012 09:10 AM, Solar Designer wrote:
> On Thu, Feb 09, 2012 at 11:47:44AM +0400, Solar Designer wrote:
>> On Thu, Feb 09, 2012 at 03:15:46AM +0100, magnum wrote:
>>> On 01/16/2012 12:12 AM, Solar Designer wrote:
>>>> Here's one more: Drupal 7 uses a revision of phpass with MD5 replaced
>>>> with SHA-512 and hashes cut at 258 bits (yes, 258 - that's a multiple of 6).
>>>> These hash encodings use the $S$ prefix.  Perhaps we should support them.
>>>
>>> I just committed this format. Painfully slow but supports OMP.

> Just why is it slower than SHA-crypt-512, though?  (With the
> current sets of test vectors.)  Somehow I thought that the latter with
> the default of rounds=5000 actually invoked the SHA-512 compression
> function about 17,000 times.  So I expected these two to provide very
> similar performance.

SHA-crypt calls SHA512_Update() 17766 times for 5000 rounds, but
sha512_block_dat_order() is only called 5021 times, and that's the slow
stuff.

> Here's a very minor optimization:
> 
> Patch attached.

Thanks, and then we can adjust the crypt_key array like this:

commit a75a857262162d6be4fcb6242b3955d916f5e938
Author: magnum <john.magnum@...hmail.com>
Date:   Thu Feb 9 09:57:25 2012 +0100

    Drupal 7: Optimisations

diff --git a/src/drupal7_fmt.c b/src/drupal7_fmt.c
index c785624..5a55111 100644
--- a/src/drupal7_fmt.c
+++ b/src/drupal7_fmt.c
@@ -64,7 +64,7 @@ static unsigned char *cursalt;
 static unsigned loopCnt;
 static unsigned char (*EncKey)[PLAINTEXT_LENGTH + 1];
 static unsigned int *EncKeyLen;
-static char (*crypt_key)[REAL_BINARY_SIZE + PLAINTEXT_LENGTH];
+static char (*crypt_key)[REAL_BINARY_SIZE];
 
 static void init(struct fmt_main *pFmt)
 {

Powered by blists - more mailing lists

Your e-mail address:

Powered by Openwall GNU/*/Linux - Powered by OpenVZ