Few important things to note with AES encryption:
- Never use plain text as encryption key. Always hash the plain text key and then use for encryption.
- Always use Random IV (initialization vector) for encryption and decryption. True randomization is important.
- As mentioned above, don't use ecb mode, use
CBC
instead.