crypt does not work in osx, returns wrong value
Question: I'm using an OSX 10.9 (last version) with the last Xcode. When I execute the
following command:

    
    
    python -c 'import crypt; print crypt.crypt("test", "$6$random_salt")'
    

I get this as an answer:

    
    
    $6asQOJRqB1i2
    

but if I execute the same in a debian machine (same version of python) I get
the following:

    
    
    $6$random_salt$sJ0ZOQCUESBs9rYCOLCqGV93zg1cSDgZV/FF6ZBzpnvNUVODwaaVoPV2SiL0ur7Sexh02hMmXdSBOa216GWoh.
    

What is wrong with my machine?


Answer: The implementation of `crypt()` on Mac OS X does not support most of the
"advanced" modes supported by the Linux glibc `crypt()`. It only supports
"traditional `crypt()`", which is what you're getting here, and an "extended
`crypt()`" mode which is not compatible with the Linux implementation either.

If you need to create strong password hashes portably across Linux and Mac OS
X, you'll need to use something other than `crypt()`.

