crypt() will return an encrypted string using the standard Unix DES-based encryption algorithm or alternative algorithms that may be available on the system.
all of these return the same result $return Value = crypt('My String Started', 'Fixed'); $return Value = crypt('My String Finished', 'Fixed'); $return Value = crypt('My String Started', 'Filtered'); $return Value = crypt('My String Finished', 'Filtered'); Basicly it only "encripts" the first 5 chars of the string with the first 2 of the salt...
use, I want to give a very quick overview of the new API: Everybody knows that you should be hashing their passwords using bcrypt, but still a surprising number of developers uses insecure md5 or sha1 hashes (just look at the recent password leaks).
One of the reasons for this is that the crypt() API is ridiculously hard to use and very prone to programming mistakes.
By adding a new, very simple to use API we hope to move more developers towards bcrypt.
Creating password hashes can't be any simpler than this: This will create a password hash using the default algorithm (currently bcrypt), the default load factor (currently 10) and an automatically generated salt.
The used algorithm and salt will also be part of the resulting hash, so you don't need to worry about them at all ;) If you don't want to stick with the defaults (which might change in the future), you can also provide algorithm and load factor yourself: Remember: The salt and algorithm are part of the hash, so you don't need to provide them separately.
As time goes by you might want to change the password hashing algorithm or load factor, or PHP may change the defaults to be more secure.
In this case new accounts should be created using the new options and existing passwords rehashed on login (you can do this only on login because you need the original password to do a rehash). The new API will only be introduced in PHP 5.5, but you can already use a PHP implementation of the same API now!
The compatibility implementation will automatically disable itself once you upgrade to 5.5.