cleaner implementation AES encryption and decryption