Added: AES_CBC support and refactorization into separate functions