Re: Password checking theorical question

From: Jean-Luc Cooke (jlcooke_at_engsoc.org)
Date: 12/10/04


Date: 10 Dec 2004 16:46:38 GMT

Arnaud ,

This is IMHO the best way to store password tokens for future
verification and requires no secret keys.

P = password (any length)
B = Number of bits of salt to use
N = Number of hash iterations to perform
S = salt (B random bytes)
H = token to store for future verification
U = username

H = Hash^N( U || S || P )
H = Hash( Hash( ... Hash( U || S || P ) ... ) )

Store:
 {U, S, H}

When asked to verify that P' belongs to user U:
 T = Hash^N( U || S || P' )
 if (T == H)
   then assume P' == P for user U

This is good for two reasons:
 - the Salt makes the space-complexity of a dictionary attack 2^B
   times harder.
   + The amount if disk-space you need to pre-compute a dictionary
 - the hash iterations makes the time-complexity of a dictioanry attack
   2^N times harder.
   + The amount of CPU time needed to pre-compute a dictionary
   + this alsomakes on-the-fly password searching attacks take 2^N times
     longer.
 - the username is optional, but help ensure that a bad random number
   generator for S isn't critical to security.
 - Usign CRC32 as your Hash() function is not advised. Why? Because no
   matter what your B and N parameters are, the difficulty of guessing a
   user's password to work is 1 in 65536. Completly unacceptable

JLC

ps. give up on CRC32.

"Arnaud Carr?" <arnaud.carreNOSPAM@freesurf.fr> wrote:

> Sorry for posting an old question with a new form. Some time ago I wanted
> your opinions about a "cheap" way of testing if a passphrase is correct or
> not without de-cyphering the complete data. I made a "cheap" method using
> CRC32. I know it sounds "horrible" to you, and it "sounds" horrible to me
> too, but I really don't see the weak. To be more precise, here is the
> description of my algo before my question:

> P = asscii passphrase, with a supposed "128 bits" entropy in our sample
> K = binary key of 256bits, obtained from P using a strong "key derivation"
> func ( PKCS-5 for exemple )

> Message is encoded with a "strong" block cypher , let's say AES-256 in CBC
> mode. (of course we suppose there is no weak in implementation, that is,
> random IV, password salt and all these boring stuff)

> When crypting, I ouput these values:

> - CRC32(P) ( 4bytes)
> - encrypted datas.

> so now my question: using poor CRC32 to store the crc of the passphrase in
> plaintext sounds horrible (even to me), but how did that CRC help an
> attacker in my case ? I mean, I don't see anything else than brute force on
> 2^128 passphrase ( I suppose 128bits of entropy) ?

> The CRC could maybe optimize a bit the brute force search by fastly removing
> passphrase with wrong CRC, but an attacker still have to do brute force on
> 2^128 passphrase ( let's say 2^127 with birhday paradox :-))

> Is there another way than brute force an attacker could use in my case ?

> thanks in advance
> Arnaud

-- 


Relevant Pages

  • Re: not sure what it all means at this point
    ... "There are seldom good technological solutions to behavioral problems." ... -i cannot mount either the public store or mailbox store (mapi call ... verification process. ... Please review the log file for more information' - ...
    (microsoft.public.exchange.admin)
  • Re: UserNameToken with SendNone on Password
    ... >> machine key store. ... > see the salt length as adding security. ... You should only return a SCT if you authenticate with correct ... The code clearly indicates where the validation should take place. ...
    (microsoft.public.dotnet.framework.webservices.enhancements)
  • Re: not sure what it all means at this point
    ... exchange at least comes up there ... then try for a restore either from .pst's or store files ... any suggestions how to get eseutil working, ... verification process. ...
    (microsoft.public.exchange.admin)
  • Re: Hidden Application Data
    ... The reason I want to hide the user's credentials is not from the user ... If you must keep things locally then do not store the ... For a new application you should use SHA-256 as the hash. ... cryptographic salt seehttp://en.wikipedia.org/wiki/Salt_. ...
    (microsoft.public.dotnet.languages.csharp)
  • Confused by salt
    ... I hope someone can help clear my confusion. ... time back that used a hash function to store a password. ... advised me that I really ought to use a salt with this in order to add ...
    (sci.crypt)