Add mcrypt_create_iv() to generateRandomKey()

If openssl_random_pseudo_bytes() isn't available for key generation, use mcrypt as a fallback