This method figures out the appropriate key size for the chosen encryption algorithm and
then hashes the given key accordingly. Note that if the key has already the needed length,
it is considered to be hashed (secure) already and is therefore not hashed again. This lets
you change the hashing method in your own code if you like.
The default MCRYPT_RIJNDAEL_128 key should be 32 byte long sha256 is used as the hashing
algorithm. If the key size is shorter than the one generated by sha256, the first n bytes
will be used.