Re: [HACKERS] Postgres: pg_hba.conf, md5, pg_shadow, encrypted

From: Antoine Martin (antoine_at_nagafix.co.uk)
Date: 04/23/05

  • Next message: Nicolas Montoza: "E-Cart v1.1 Remote Command Execution"
    To: Stephen Frost <sfrost@snowman.net>
    Date: Sat, 23 Apr 2005 15:53:25 +0100
    
    

    On Sat, 2005-04-23 at 09:02 -0400, Stephen Frost wrote:
    > * Antoine Martin (antoine@nagafix.co.uk) wrote:
    > > Basically, multiple input data that have the same output hash, which is
    > > of no use when what you are trying to find is the input.
    > > Finding collisions quicker for a known input is one thing, but that is
    > > not going to reduce the search space, not even your storage space (it is
    > > unlikely that the colliding results would all be valid input).
    >
    > Erm, you aren't necessairly trying to find the input... It may be the
    > case that you're trying to find what you need to authenticate to this
    > server, or any other PostgreSQL server where the same userid & input are
    > used. In that case you just need something that hashes to the same
    > thing.
    Agreed, what I said was that it is highly unlikely you will find
    colliding inputs that are valid, so the "SHA weakness" does not really
    help you here as it does not reduce the search space:
    You are much better off pre-calculating hashes for possible usernames &
    passwords than working backwards and generating all possible hashes
    hoping that one would happen to be matching a real entry...
    Usernames are not exactly random, passwords are less predictable, the
    chance of a useful collision on the username+password is remote at best.
    > Using a random salt would mean that it's different per server so
    > breaking it on one doesn't help you against another server unless you
    > happened to find the actual original input.
    Absolutely.
    >
    > > Is adding the non-guessable salt that hard anyway?
    >
    > It is if you want to continue to support the 'md5' method in pg_hba.conf
    > because the wireline protocol will probably need to change. A less
    > intrusive alternative would be to add an 'with encrypted password 'xyz'
    > with random salt' or some such which would only be supported with the
    > 'password' method in pg_hba.conf.
    >
    > One problem with this is that you then can't just switch from password
    > to md5 or back again. Perhaps that's ok though? Comments?
    Just add another authentication method - call it 'md5-salt' (sharing
    most of the 'md5' code), you get backwards compatibility and you advise
    users to migrate to the new salt hash. Shouldn't be too hard...
    Might as well do a 'sha512-salt' too.

    Antoine


  • Next message: Nicolas Montoza: "E-Cart v1.1 Remote Command Execution"

    Relevant Pages

    • Re: [HACKERS] Postgres: pg_hba.conf, md5, pg_shadow, encrypted
      ... server, or any other PostgreSQL server where the same userid & input are ... Using a random salt would mean that it's different per server so ... It is if you want to continue to support the 'md5' method in pg_hba.conf ...
      (Bugtraq)
    • Re: MD5 Algorithm
      ... you apply the MD5 to the timedate stamp ... provided by the server and you use a key code string also provided. ... The idea is sending a message, message digest (firstly mentioned ... The recipient of the message decrypts the key with your public key, ...
      (comp.lang.forth)
    • LDAP, MD5, and password changes
      ... Here is my dilemma- We have SunONE Directory Server 5.2 patch 2. ... Previously, user passwords were encrypted using simple crypt, but we ... wanted to harden the mechanism and tested using MD5. ... We are encrypting ...
      (SunManagers)
    • Re: Current thoughts on system partitioning
      ... > Just to use my specific example, I've built a server with two 160 GB ... In my experience, SuSE by default installs DES encryption for passwords, ... you can switch the SuSE to MD5 ...
      (comp.os.linux.setup)
    • Re: Current thoughts on system partitioning
      ... > Just to use my specific example, I've built a server with two 160 GB ... In my experience, SuSE by default installs DES encryption for passwords, ... you can switch the SuSE to MD5 ...
      (comp.os.linux.misc)