PHP mcrypt AES encryption wrapper
You should use a key strengthening function like PKBDF2, scrypt or bcrypt to generate a key from the password.
The part with XTEA is useless: you're relying on security through obscurity.
You shouldn't hash before encrypting if you want to ensure the data has not been tampered with. Use HMAC SHA-256 on the encrypted data.

And finally: don't write your own crypto algorithm. Use well known and audited solutions.