AIX

AIX

Connect with fellow AIX users and experts to gain knowledge, share insights, and solve problems.


#Power
#Power
 View Only

crypt() API in AIX7.1 for blowfish salt is not working as expected instead it is returning DES hash value.

  • 1.  crypt() API in AIX7.1 for blowfish salt is not working as expected instead it is returning DES hash value.

    Posted Wed August 27, 2014 10:41 AM

    Originally posted by: S.Ashutosh


    I am writing a password reset utility on AIX (7.1.0.0) and I need to support SMD5, SSHA256, SSHA512 and BLOWFISH password hash algorithms. I have successfully implemented the code for SMD5, SSHA256 and SSHA512. However, for BLOWFISH algorithm the 'crypt' API still returns normal DES hash and not the BLOWFISH hash. I tried different prefixes in salt value - {sblowfish} {sblowfish}08$ {SBLOWFISH} {SBLOWFISH}08$. However, I still don't get blowfish hash. For, AIX 5.3 {sblowfish} prefix in salt value works and I get required hash. However, for AIX 7.1 it doesn't work.

    The format for the salt value I am using is as follows -
    MD5 - {smd5}<randomly generated 8 characters>$
    SHA256 - {ssha256}06$<randomly generated 8 characters>$
    SHA512 - {ssha512}06$<randomly generated 8 characters>$
    BLOWFISH - {sblowfish}08$<randomly generated 22 characters>$

    I then pass the user password and salt value to the 'crypt' API in 'C'.

    crypt(password, salt);

    For MD5, SHA256 and SHA512 I get the password hash which is compliant to the corresponding algorithm. However, for BLOWFISH salt, the 'crypt' API rejects the salt and instead returns normal DES hash though i have the blowfish in the system.

    Can anybody please help out here?
    Thanks in advance.


    #AIX-Forum