Upon looking at Mcrypt_encrypt on the manual, I see that it requires a key. Is there another function or something that allows using a password instead? How would the code look then?
You can try openssl_encrypt() & openssl_decrypt()
and check this answer for a very detailed example.