refactoring, add aes encrypt function