Have encrypt() encrypt the passwords using the SHA-256 scheme instead of the default DES scheme

The default DES scheme used by crypt() only considers the first 8 characters of a password, as I discovered to my surprise. Prefixing the salt value with the string '$5$' makes crypt() use the SHA-256 scheme, which apart from having no character limit, is more secure in the event of a data leak.

I append a random MD5 string to the prefix, otherwise encrypt() would produce identical hashes for the same passwords. It's a bit more complex, but it works.
Merge pull request #1 from thoughtmonster/patch-1

Have encrypt() encrypt the passwords using the SHA-256 scheme