combine exception handling and iv/cipher length check